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.
FORCE)
ENDIF(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)
# include packages we depend on
FIND_PACKAGE(Qt4)
SET(QT_USE_QTOPENGL 1)
FIND_PACKAGE(Boost)
FIND_PACKAGE(PythonLibs)
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 )
# 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} )
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
TARGET_LINK_LIBRARIES(mussagl
${BOOST_PROGRAM_OPTIONS_LIBRARY}
${BOOST_FILESYSTEM_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)
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
ADD_TEST(core_test ${CMAKE_BINARY_DIR}/alg/test/unittest)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/alg})
TARGET_LINK_LIBRARIES(unittest
${BOOST_UNIT_TEST_LIBRARY}
${BOOST_FILESYSTEM_LIBRARY}
${BOOST_UNIT_TEST_LIBRARY}
${BOOST_FILESYSTEM_LIBRARY}
- ${BOOST_SERIALIZATION_LIBRARY}
${OPENGL_gl_LIBRARY})
SET_TARGET_PROPERTIES(
${OPENGL_gl_LIBRARY})
SET_TARGET_PROPERTIES(
ADD_LIBRARY(mussa MODULE ${SOURCES})
ADD_LIBRARY(mussa_py STATIC ${SOURCES})
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
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})
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
TARGET_LINK_LIBRARIES(mussa_python_test
${QT_LIBRARIES}
${OPENGL_gl_LIBRARY}
${BOOST_PROGRAM_OPTIONS_LIBRARY}
${QT_LIBRARIES}
${OPENGL_gl_LIBRARY}
${BOOST_PROGRAM_OPTIONS_LIBRARY}