comparison CMakeLists.txt @ 12:c38716a8a146

static link against MSVC CRT
author Administrator@jodogne-w01
date Fri, 20 Jul 2012 12:14:01 +0200
parents 3a584803783e
children e85455ff6039
comparison
equal deleted inserted replaced
11:09f1eceaccec 12:c38716a8a146
33 33
34 if (${CMAKE_COMPILER_IS_GNUCXX}) 34 if (${CMAKE_COMPILER_IS_GNUCXX})
35 set(CMAKE_C_FLAGS "-Wall -pedantic -Wno-implicit-function-declaration") # --std=c99 makes libcurl not to compile 35 set(CMAKE_C_FLAGS "-Wall -pedantic -Wno-implicit-function-declaration") # --std=c99 makes libcurl not to compile
36 set(CMAKE_CXX_FLAGS "-Wall -pedantic -Wno-long-long -Wno-variadic-macros") 36 set(CMAKE_CXX_FLAGS "-Wall -pedantic -Wno-long-long -Wno-variadic-macros")
37 elseif (${MSVC}) 37 elseif (${MSVC})
38 # http://stackoverflow.com/a/6510446
39 foreach(flag_var
40 CMAKE_C_FLAGS_DEBUG
41 CMAKE_CXX_FLAGS_DEBUG
42 CMAKE_C_FLAGS_RELEASE
43 CMAKE_CXX_FLAGS_RELEASE
44 CMAKE_C_FLAGS_MINSIZEREL
45 CMAKE_CXX_FLAGS_MINSIZEREL
46 CMAKE_C_FLAGS_RELWITHDEBINFO
47 CMAKE_CXX_FLAGS_RELWITHDEBINFO)
48 string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
49 string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}")
50 endforeach(flag_var)
38 add_definitions( 51 add_definitions(
39 -D_CRT_SECURE_NO_WARNINGS=1 52 -D_CRT_SECURE_NO_WARNINGS=1
40 -D_CRT_SECURE_NO_DEPRECATE=1 53 -D_CRT_SECURE_NO_DEPRECATE=1
41 ) 54 )
42 include_directories(${CMAKE_SOURCE_DIR}/Resources/VisualStudio) 55 include_directories(${CMAKE_SOURCE_DIR}/Resources/VisualStudio)
143 PalantirServer/ToDcmtkBridge.cpp 156 PalantirServer/ToDcmtkBridge.cpp
144 PalantirServer/ToDcmtkBridge.cpp 157 PalantirServer/ToDcmtkBridge.cpp
145 PalantirServer/DicomIntegerPixelAccessor.cpp 158 PalantirServer/DicomIntegerPixelAccessor.cpp
146 ) 159 )
147 160
161 # Ensure autogenerated code is built before building ServerLibrary
162 add_dependencies(ServerLibrary CoreLibrary)
163
148 add_executable(Palantir 164 add_executable(Palantir
149 PalantirServer/main.cpp 165 PalantirServer/main.cpp
150 ) 166 )
151 167
152 add_executable(UnitTests 168 add_executable(UnitTests