From: Brandon King Date: Sat, 12 Aug 2006 00:17:06 +0000 (+0000) Subject: Reorder libraries for win32 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=2e517c1bb373f0c0f11b8f78d13e8adb87be66a8 Reorder libraries for win32 Also remove the stuff that conditionally compiled python since we now pretty strongly depend on it. And remember mingw32 really needs the library with the most dependencies to be listed first. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 854ba6e..0ce4b69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,6 @@ IF(NOT CMAKE_BUILD_TYPE) FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) -# configure python -SET(USE_PYTHON 1) - # include packages we depend on FIND_PACKAGE(Qt4) SET(QT_USE_QTOPENGL 1) @@ -26,6 +23,11 @@ FIND_PACKAGE(OpenGL) FIND_PACKAGE(Boost) FIND_PACKAGE(PythonLibs) +INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH} + ${QT_INCLUDES} + ${BOOST_INCLUDE_DIR} ) + + # all of our source files al relative to the root of our project INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) ADD_SUBDIRECTORY( doc ) @@ -38,27 +40,20 @@ SET(MAIN_SOURCES ADD_EXECUTABLE(mussagl WIN32 MACOSX_BUNDLE ${MAIN_SOURCES} ) + +SET(PYTHON_CFLAGS "-DUSE_PYTHON") + +# For windows you need to go from library with the most dependencies +# to the library with the least dependencies -diane TARGET_LINK_LIBRARIES(mussagl - mussa_core mussa_qui + mussa_py + mussa_core ${QT_LIBRARIES} - ${OPENGL_gl_LIBRARY} ${BOOST_PROGRAM_OPTIONS_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY} - ${BOOST_SERIALIZATION_LIBRARY} ) -IF(USE_PYTHON) - INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) - SET(PYTHON_CFLAGS "-DUSE_PYTHON") - TARGET_LINK_LIBRARIES(mussagl - mussa_py - ${BOOST_PYTHON_LIBRARY} - optimized ${PYTHON_LIBRARIES} - debug ${PYTHON_DEBUG_LIBRARIES} - ) -ENDIF(USE_PYTHON) - GET_MUSSA_COMPILE_FLAGS(MAIN_CFLAGS) GET_MUSSA_LINK_FLAGS(MAIN_LDFLAGS) diff --git a/alg/test/CMakeLists.txt b/alg/test/CMakeLists.txt index 17e2c26..aca6071 100644 --- a/alg/test/CMakeLists.txt +++ b/alg/test/CMakeLists.txt @@ -25,10 +25,9 @@ ADD_EXECUTABLE(unittest ${SOURCES}) ADD_TEST(core_test ${CMAKE_BINARY_DIR}/alg/test/unittest) LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/alg}) TARGET_LINK_LIBRARIES(unittest - mussa_core ${BOOST_UNIT_TEST_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY} - ${BOOST_SERIALIZATION_LIBRARY} + mussa_core ${OPENGL_gl_LIBRARY}) SET_TARGET_PROPERTIES( diff --git a/py/CMakeLists.txt b/py/CMakeLists.txt index 5750a52..022ef5a 100644 --- a/py/CMakeLists.txt +++ b/py/CMakeLists.txt @@ -25,9 +25,17 @@ IF(BOOST_PYTHON_LIBRARY) ADD_LIBRARY(mussa MODULE ${SOURCES}) ADD_LIBRARY(mussa_py STATIC ${SOURCES}) - ADD_CUSTOM_TARGET(mussa.so ALL - COMMAND cp libmussa.so mussa.so - DEPENDS mussa) + # Any suggestions for a more elegant solution to this? -diane + IF(WIN32) + ADD_CUSTOM_TARGET(mussa.dll ALL + COMMAND copy libmussa.dll mussa.dll + DEPENDS mussa) + ELSE(WIN32) + # Not win32, aka linux and mac + ADD_CUSTOM_TARGET(mussa.so ALL + COMMAND cp libmussa.so mussa.so + DEPENDS mussa) + ENDIF(WIN32) LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/alg) TARGET_LINK_LIBRARIES(mussa mussa_core diff --git a/py/test/CMakeLists.txt b/py/test/CMakeLists.txt index bf03795..aa09842 100644 --- a/py/test/CMakeLists.txt +++ b/py/test/CMakeLists.txt @@ -16,10 +16,11 @@ SET_SOURCE_FILES_PROPERTIES( ADD_EXECUTABLE(mussa_python_test ${SOURCES}) ADD_TEST(mussa_python_test ${CMAKE_BINARY_DIR}/py/test/mussa_python_test) LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/alg}) +# Really it is important to go from library with the most dependencies to least TARGET_LINK_LIBRARIES(mussa_python_test - mussa_core mussa_qui mussa_py + mussa_core ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${BOOST_PROGRAM_OPTIONS_LIBRARY}