CMakeLists.txt 2.34 KB
Newer Older
adelmann's avatar
adelmann committed
1 2 3
#-----------------------------------------------------------------------------
# options

gsell's avatar
gsell committed
4
option (ARCH_BG "Set architecture to BlueGene" OFF)
adelmann's avatar
adelmann committed
5 6 7 8 9 10 11 12 13 14 15 16

#-----------------------------------------------------------------------------
# Common sources and libs

# add_sources macro implemented by Christof Kraus
# for all common source files (Expressions and Utils)

set (_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
macro (add_sources)
    file (RELATIVE_PATH _relPath "${_SRC_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
    foreach (_src ${ARGN})
        if (_relPath)
adelmann's avatar
adelmann committed
17
            list (APPEND OPTP_SRCS "${CMAKE_SOURCE_DIR}/optimizer/${_relPath}/${_src}")
adelmann's avatar
adelmann committed
18
        else()
adelmann's avatar
adelmann committed
19
            list (APPEND OPTP_SRCS "${CMAKE_SOURCE_DIR}/optimizer/${_src}")
adelmann's avatar
adelmann committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33
        endif()
    endforeach()
    if (_relPath)
        # propagate SRCS to parent directory
        set (OPTP_SRCS ${OPTP_SRCS} PARENT_SCOPE)
    endif()
endmacro()

set (OPTP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)

add_subdirectory (Expression)
add_subdirectory (Util)
add_subdirectory (extlib)

iff's avatar
iff committed
34 35 36
#-----------------------------------------------------------------------------
# Build liboptp for linking to OPAL
#
gsell's avatar
gsell committed
37 38 39

include_directories (${CMAKE_CURRENT_SOURCE_DIR})
add_library (optp ${OPTP_SRCS} ${PILOT_OPAL_SRCS})
40 41 42
# Set OPTP variables everywhere (childs and parents)
set (OPTP_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "" FORCE)
set (OPTP_LIBRARY "optp" CACHE INTERNAL "" FORCE)
iff's avatar
iff committed
43 44 45
set (OPTP_LIBS
    pthread
    m
46
    ${Boost_LIBRARIES}
iff's avatar
iff committed
47
    wfgHypervolume
48
    CACHE INTERNAL "" FORCE
adelmann's avatar
adelmann committed
49 50 51 52
)

#-----------------------------------------------------------------------------
# Testing
53

gsell's avatar
gsell committed
54
if (BUILD_OPAL_UNIT_TESTS)
55 56
    enable_testing()
    add_subdirectory(Tests)
gsell's avatar
gsell committed
57
endif ()
iff's avatar
iff committed
58

adelmann's avatar
adelmann committed
59 60
#-----------------------------------------------------------------------------
# Doxygen
61 62 63 64 65 66 67 68 69 70 71 72
if (ENABLE_DOXYDOC)
    find_package(Doxygen)
    if (DOXYGEN_FOUND)
        configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile
            ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY
	    )
        add_custom_target (optpilot-doc
            ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
            COMMENT "Generating API documentation with Doxygen" VERBATIM
            )
    endif ()
gsell's avatar
gsell committed
73
endif ()
gsell's avatar
gsell committed
74 75 76 77 78 79 80 81

# vi: set et ts=4 sw=4 sts=4:
  
# Local Variables:
# mode: cmake
# cmake-tab-width: 4
# indent-tabs-mode: nil
# End: