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)
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 )
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)
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(
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
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}