Reorder libraries for win32
[mussa.git] / 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)