Skip to content

Commit

Permalink
Fix review finding, clean cmake files and add launcher build
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjoe committed Jan 4, 2018
1 parent 838f797 commit eb64d51
Show file tree
Hide file tree
Showing 32 changed files with 378 additions and 1,205 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ CMakeFiles
CMakeCache.txt
CPackConfig.cmake
CPackSourceConfig.cmake
cmake_*

# Packages #
############
Expand Down
55 changes: 11 additions & 44 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,27 @@
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.2.0)
project(macchina.io)

option(POCO_VERBOSE_MESSAGES "Enable informational messages during configure" ON)

file(STRINGS "${PROJECT_SOURCE_DIR}/libversion" SHARED_LIBRARY_VERSION)

# Read the version information from the VERSION file
file (STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION )
if(POCO_VERBOSE_MESSAGES)
message(STATUS "Poco package version: ${PACKAGE_VERSION}")
endif()
message(STATUS "macchina.io version: ${PACKAGE_VERSION}")
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MAJOR ${PACKAGE_VERSION})
string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MINOR ${PACKAGE_VERSION})
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION})

set(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
set(RELEASE_NAME "Unstable-trunk")
set(PROJECT_VERSION ${COMPLETE_VERSION})
set(CMAKE_C_STANDARD 99)

set(OSNAME ${CMAKE_SYSTEM_NAME})
set(OSARCH ${CMAKE_SYSTEM_PROCESSOR})
set(PROJECT_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})

# Put the libaries and binaries that get built into directories at the
# top of the build tree rather than in hard-to-find leaf
# directories. This simplifies manual testing and the use of the build
# tree rather than installed Boost libraries.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${OSNAME}/${OSARCH})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${OSNAME}/${OSARCH})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR})
# Windows DLLs are "runtime" for CMake. Output them to "bin" like the Visual Studio projects do.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR})

# Append our module directory to CMake
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_BINARY_DIR}/macchina.io ${CMAKE_BINARY_DIR}/Poco)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/platform/OSP/cmake)

if(POCO_STATIC)
set(LIB_MODE_DEFINITIONS -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS)
set(LIB_MODE STATIC)
if(POCO_VERBOSE_MESSAGES)
message(STATUS "Building static libraries")
endif()
else(POCO_STATIC)
set(LIB_MODE SHARED)
set(LIB_MODE_DEFINITIONS -DPOCO_NO_AUTOMATIC_LIBS)
if(POCO_VERBOSE_MESSAGES)
message(STATUS "Building dynamic libraries")
endif()
endif(POCO_STATIC)

set(ENABLE_MONGODB OFF CACHE BOOL "Enable MongoDB" FORCE)
set(ENABLE_PDF OFF CACHE BOOL "Enable PDF" FORCE)
set(ENABLE_DATA_MYSQL OFF CACHE BOOL "Enable Data MySQL" FORCE)
set(ENABLE_DATA_POSTGRESQL OFF CACHE BOOL "Enable Data PosgreSQL" FORCE)
set(ENABLE_DATA_ODBC OFF CACHE BOOL "Enable Data ODBC" FORCE)
set(ENABLE_SEVENZIP OFF CACHE BOOL "Enable SevenZip" FORCE)
set(ENABLE_APACHECONNECTOR OFF CACHE BOOL "Enable ApacheConnector" FORCE)
set(ENABLE_CPPPARSER OFF CACHE BOOL "Enable C++ parser" FORCE)
set(ENABLE_POCODOC OFF CACHE BOOL "Enable Poco Documentation Generator" FORCE)

# Build third party libraries
add_subdirectory(platform)
Expand All @@ -79,9 +43,12 @@ add_subdirectory(platform/OSP/Net)
add_subdirectory(platform/OSP/Web)

# Build sample
#add_subdirectory(platform/OSP/samples/WebInfo)
add_subdirectory(platform/OSP/samples/WebInfo)
add_subdirectory(platform/OSP/samples/ServiceListener)

add_subdirectory(launcher)
add_subdirectory(server)

add_dependencies(osp.core bundle)
add_dependencies(poco.net bundle)
add_dependencies(osp.web bundle)
Expand Down
127 changes: 0 additions & 127 deletions cmake/DefinePlatformSpecifc.cmake

This file was deleted.

94 changes: 0 additions & 94 deletions cmake/FindAPR.cmake

This file was deleted.

31 changes: 0 additions & 31 deletions cmake/FindApache2.cmake

This file was deleted.

Loading

0 comments on commit eb64d51

Please sign in to comment.