Reorder libraries for win32
authorBrandon King <kingb@caltech.edu>
Sat, 12 Aug 2006 00:17:06 +0000 (00:17 +0000)
committerBrandon King <kingb@caltech.edu>
Sat, 12 Aug 2006 00:17:06 +0000 (00:17 +0000)
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.

CMakeLists.txt
alg/test/CMakeLists.txt
py/CMakeLists.txt
py/test/CMakeLists.txt

index 854ba6e213ce126cc1c9ff6b45269c33b8512a1f..0ce4b69fabad78c8255c1ffe5fc046a9100e1ed3 100644 (file)
@@ -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)
 
index 17e2c26ddd36b798fa833e0d7c68871463846532..aca60711d59309a073f524398b049d820358e82d 100644 (file)
@@ -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(
index 5750a5263644f1d21b2e03c356108cd01eb7d179..022ef5adb21f72c06e37c050749c002da391acc8 100644 (file)
@@ -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
index bf03795f88203d4aa8b7290492c3c4bd954d77eb..aa0984261b05f16a794a2ff0226eff39471d7124 100644 (file)
@@ -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}