Works fine on windows
by default CMAKE_BUILD_TYPE is set to Debug in windows
by default CMAKE_BUILD_TYPE is set to RelWithDebInfo in Linux
till now it works only on windows with vs-runtime
@@ -14,9 +14,6 @@ configure_file (
# Include Directories
include_directories (inc)
include_directories (lib)
-include_directories (lib/sqlite)# windows specific
-include_directories (srb_test/odb32/libodb-2.4.0)# windows specific
-include_directories (srb_test/odb32/libodb-sqlite-2.4.0)# windows specific
# Detect OS
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -53,15 +50,18 @@ if (OSX)
endif ()
if (WINDOWS)
- # set (Boost_DEBUG ON)
+ #set (CMAKE_EXE_LINKER_FLAGS "-static")
set (Boost_USE_STATIC_LIBS ON) # only find static libs
endif ()
if (WINDOWS)
+ include_directories (lib/sqlite)# windows specific
+ include_directories (srb_test/odb32/libodb-2.4.0)# windows specific
+ include_directories (srb_test/odb32/libodb-sqlite-2.4.0)# windows specific
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
- if (NOT CMAKE_BUILD_TYPE)
- set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
- endif ()
+ set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
+ # to be changed lateron
+ set (EXT_LIB_PATH "C:/srb_test/lib32" CACHE STRING "Absolute path to libraries installation folder.")
else ()
# no unknown pragmas: ODB compiler uses some pragmas that the regular compiler doesn't need
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-unknown-pragmas")
@@ -70,18 +70,14 @@ else ()
set (CMAKE_C_FLAGS " -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_OMIT_LOAD_EXTENSION")
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
- endif ()
-endif ()
-if (WINDOWS)
- #find_package (Boost COMPONENTS filesystem iostreams program_options regex log thread system REQUIRED )
- # to be changed lateron
- set (EXT_LIB_PATH "C:/srb_test/lib32" CACHE STRING "Absolute path to libraries installation folder.")
-else ()
find_package (Boost COMPONENTS filesystem iostreams program_options regex log thread system REQUIRED )
set (EXT_LIB_PATH "usr/local/lib" CACHE STRING "Absolute path to libraries installation folder.")
-endif()
include_directories (${Boost_INCLUDE_DIR} )
+ endif ()
+endif ()
+message("cmake build type is ${CMAKE_BUILD_TYPE}")
+
find_package (Threads REQUIRED)
