Permalink
Browse files

cmake: fix Boost Thread linking on Windows

* Define BOOST_THREAD_BUILD_LIB instead of BOOST_THREAD_BUILD_DLL
  in external_libraries, as we are building a static lib.

* Define BOOST_THREAD_USE_LIB for the rest of the project
  • Loading branch information...
1 parent 02cb466 commit 5ea30c698f10ecd254a05a9ac17aadf54b2e69a3 @jleben jleben committed Mar 29, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −0 CMakeLists.txt
  2. +1 −1 external_libraries/CMakeLists.txt
View
@@ -125,6 +125,9 @@ if(WIN32)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} /MTd")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} /MT")
endif()
+
+ # correctly link the static Boost Thread library:
+ add_definitions(-DBOOST_THREAD_USE_LIB)
endif()
@@ -9,7 +9,7 @@ include_directories(boost)
if(WIN32)
aux_source_directory(boost/libs/thread/src/win32/ boost_thread_platform )
- add_definitions(-DBOOST_THREAD_BUILD_DLL)
+ add_definitions(-DBOOST_THREAD_BUILD_LIB)
elseif(PTHREADS_FOUND)
aux_source_directory(boost/libs/thread/src/pthread/ boost_thread_platform )
else()

0 comments on commit 5ea30c6

Please sign in to comment.