cmake_minimum_required( VERSION 2.8.5 ) project( boost ) file( GLOB_RECURSE headers boost/*.hpp ) install( DIRECTORY boost DESTINATION "${BOOST_DESTROOT}/include" ) macro( find_and_use_package name ) find_package( ${name} REQUIRED ) include_directories( ${${name}_INCLUDE_DIRS} ) link_directories ( ${${name}_LIBRARY_DIRS} ) endmacro( find_and_use_package ) find_and_use_package( ZLIB ) find_and_use_package( BZIP2 ) find_and_use_package( EXPAT ) # Since we are building under MacPorts, we can ASSUME that the 'icu' package has been installed as a prerequisite execute_process( COMMAND ${MACPORTS_PREFIX}/bin/icu-config --cppflags OUTPUT_VARIABLE ICU_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND ${MACPORTS_PREFIX}/bin/icu-config --ldflags OUTPUT_VARIABLE ICU_LIBRARY_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE ) include_directories( ICU_INCLUDE_DIRS} ) link_directories ( ICU_LIBRARY_DIRS} ) include_directories( . ) macro( add_boost_library name directory ) set( name "${name}" ) set( directory "${directory}" ) # *** rm ../boost/pch.hpp # *** include_directories( ${directory} ) # *** HMM... math has a header in one of the sub-dirs... maybe save current include directories, add, then pop? # *** see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:COMPILE_FLAGS file( GLOB_RECURSE boost_${name}_sources ${directory}/*.cpp ) add_library( boost_${name} SHARED ${boost_${name}_sources} ) set_target_properties( boost_${name} PROPERTIES PREFIX "libboost_" ) set_target_properties( boost_${name} PROPERTIES LINKER_LANGUAGE CXX ) add_library( boost_${name}-static STATIC ${boost_${name}_sources} ) set_target_properties( boost_${name}-static PROPERTIES OUTPUT_NAME "${name}" ) set_target_properties( boost_${name}-static PROPERTIES PREFIX "libboost_" ) set_target_properties( boost_${name}-static PROPERTIES LINKER_LANGUAGE CXX ) install( TARGETS boost_${name} boost_${name}-static LIBRARY DESTINATION "${BOOST_DESTROOT}/lib" NAMELINK_SKIP ARCHIVE DESTINATION "${BOOST_DESTROOT}/lib" ) endmacro( add_boost_library ) add_boost_library( math libs/math/src ) # *** TODO - add support for precompiled headers, or just fake it? # *** TODO - python and openmpi # *** TODO - install the headers and libraries #@ find . -type d -name "src" | grep -v '/doc/' # libs/chrono/src # libs/date_time/src # libs/exception/src # libs/filesystem/v2/src # libs/filesystem/v3/src # libs/graph/src # libs/graph_parallel/src # libs/iostreams/src # libs/locale/src # libs/math/src # libs/mpi/src # libs/mpl/preprocessed/src # libs/program_options/src # libs/random/src # libs/regex/src # libs/serialization/src # libs/signals/src # libs/smart_ptr/src # libs/system/src # libs/test/src # libs/test/tools/console_test_runner/src # libs/thread/src # libs/timer/src # libs/wave/src # # libs/python/src # libs/mpi/src/python # # libs/python/pyste/src