X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=CMakeLists.txt;h=59fba73805356ac8808ab569f7d3e18e60f224f9;hp=755d6d86d4c8678f40edbf5e7fa99ed37e20aaaf;hb=HEAD;hpb=1e6617194d9184cf4ca7069291fb3d9ae7467dc0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 755d6d8..59fba73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ PROJECT(mussa) ENABLE_TESTING() -CMAKE_MINIMUM_REQUIRED(VERSION 2.4) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) # try to include our cmake modules SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/makelib) INCLUDE(Platform) @@ -21,17 +21,28 @@ IF(QT_QTASSISTANT_FOUND) ENDIF(QT_QTASSISTANT_FOUND) INCLUDE( ${QT_USE_FILE} ) FIND_PACKAGE(OpenGL) -FIND_PACKAGE(Boost) +set(Boost_USE_STATIC_LIBS OFF) +set(Boost_USE_MULTITHREADED ON) +FIND_PACKAGE(Boost 1.40 REQUIRED filesystem serialization system program_options ) +FIND_PACKAGE(Boost 1.40 COMPONENTS python) FIND_PACKAGE(PythonLibs) +SET(USE_PYTHON 0 CACHE BOOL + "Build mussa executable linked to python interpreter") + INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH} ${QT_INCLUDES} - ${BOOST_INCLUDE_DIR} ) + ${Boost_INCLUDE_DIR} ) # all of our source files al relative to the root of our project INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) ADD_SUBDIRECTORY( doc ) +IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/paircomp) + MESSAGE(STATUS "Found paircomp") + SET(USE_PAIRCOMP 1) + ADD_SUBDIRECTORY( paircomp ) +ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/paircomp) ADD_SUBDIRECTORY( alg ) ADD_SUBDIRECTORY( qui ) ADD_SUBDIRECTORY( py ) @@ -41,27 +52,33 @@ 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_qui - mussa_py mussa_core ${QT_LIBRARIES} # Including QT_LIBS twice is for dealing with linking dependancies # related to Qt Assistant Client on windows ${QT_LIBRARIES} - ${BOOST_FILESYSTEM_LIBRARY} - ${BOOST_SERIALIZATION_LIBRARY} - ${BOOST_PROGRAM_OPTIONS_LIBRARY} - ${BOOST_PYTHON_LIBRARY} - ${PYTHON_LIBRARIES} - ${PYTHON_LINK_LIBRARIES} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_SERIALIZATION_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPENGL_gl_LIBRARY} ) +IF(USE_PYTHON) + SET(PYTHON_CFLAGS "-DUSE_PYTHON") + TARGET_LINK_LIBRARIES(mussagl + mussa_py + ${QT_LIBRARIES} +#mussaqui_py + ${Boost_PYTHON_LIBRARY} + ${PYTHON_LIBRARIES} + ${PYTHON_LINK_LIBRARIES}) +ENDIF(USE_PYTHON) + GET_MUSSA_COMPILE_FLAGS(MAIN_CFLAGS) GET_MUSSA_LINK_FLAGS(MAIN_LDFLAGS)