Skip to content

Commit

Permalink
cmake build system: better win32 support
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Blechmann <tim@klingt.org>
  • Loading branch information
timblechmann committed Mar 6, 2011
1 parent 40cbca5 commit d617012
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if (NOT PTHREADS_FOUND)
endif()
include_directories(${PTHREADS_INCLUDE_DIR})

if (MSVC)
if (MSVC OR MINGW)
set(MATH_LIBRARY "")
else()
find_library(MATH_LIBRARY m)
Expand Down
16 changes: 9 additions & 7 deletions external_libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ aux_source_directory(boost/libs/thread/src/ boost_thread )

include_directories(boost)

if (PTHREADS_FOUND)
aux_source_directory(boost/libs/thread/src/pthread/ boost_thread_posix )
add_library(boost_thread STATIC ${boost_thread} ${boost_thread_posix})
target_link_libraries(boost_thread ${PTHREADS_LIBRARY})

include_directories(${PTHREADS_INCLUDE_DIR})
if(WIN32)
aux_source_directory(boost/libs/thread/src/win32/ boost_thread_platform )
elseif(PTHREADS_FOUND)
aux_source_directory(boost/libs/thread/src/pthread/ boost_thread_platform )
else()
message(SEND_ERROR "we need to implement boost_thread for non-posix systems")
message(SEND_ERROR "we need to implement boost_thread")
endif()

add_library(boost_thread STATIC ${boost_thread} ${boost_thread_platform})
target_link_libraries(boost_thread ${PTHREADS_LIBRARY})

include_directories(${PTHREADS_INCLUDE_DIR})


aux_source_directory(boost/libs/program_options/src/ boost_program_options )
Expand Down
11 changes: 11 additions & 0 deletions lang/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
find_package(FFTW3f)

include_directories(${CMAKE_SOURCE_DIR}/include/common
${CMAKE_SOURCE_DIR}/include/lang
${CMAKE_SOURCE_DIR}/include/plugin_interface
Expand Down Expand Up @@ -233,6 +235,15 @@ elseif(NOT NO_LIBSNDFILE)
message(SEND_ERROR "Cannot find libsndfile")
endif(SNDFILE_FOUND)

if (FFTW3F_FOUND)
include_directories (${FFTW3F_INCLUDE_DIR})
target_link_libraries(libsclang ${FFTW3F_LIBRARY})
endif()

if (WIN32)
target_link_libraries(libsclang wsock32 ws2_32)
endif()

if (GC_SANITYCHECK)
add_definitions(-DGC_SANITYCHECK)
endif()
Expand Down
13 changes: 13 additions & 0 deletions server/scsynth/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
find_package(Sndfile)
if (WIN32)
find_package(Portaudio)
endif()

# here we choose who provides us with the FFT lib
if (FFT_GREEN)
Expand Down Expand Up @@ -162,6 +165,16 @@ elseif(AUDIOAPI STREQUAL coreaudio)
target_link_libraries(libscsynth "-framework CoreAudio")
endif()

if(PTHREADS_FOUND)
target_link_libraries(libscsynth ${PTHREADS_LIBRARIES})
endif()


if (WIN32)
target_link_libraries(libscsynth wsock32 ws2_32)
endif()


set_property(TARGET libscsynth PROPERTY OUTPUT_NAME scsynth)
# These two properties are ABI version info, not sc version:
set_property(TARGET libscsynth PROPERTY VERSION 1.0.0)
Expand Down

0 comments on commit d617012

Please sign in to comment.