Nimrod/A Native Optimisation Library for Nimrod/OK
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

145 lines
3.4 KiB

cmake_minimum_required(VERSION 3.1)
project(nimroda)
enable_language(C CXX)
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
include(GNUInstallDirs)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Include C/IO and build it statically
set(CIO_BUILD_STATIC ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(cio)
option(NIMRODA_BUILD_STATIC "Build Nimrod/A as a static library." ON)
if(NIMRODA_BUILD_STATIC)
set(NIMRODA_STATIC 1)
set(NIMRODA_LIBRARY_TYPE STATIC)
else()
add_definitions(-DNIMRODA_EXPORTS)
set(NIMRODA_LIBRARY_TYPE SHARED)
endif()
set(NIMRODA_GENERATED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include" )
configure_file("${PROJECT_SOURCE_DIR}/include/public/nimroda/config.h.in"
"${NIMRODA_GENERATED_INCLUDE_DIR}/nimroda/config.h")
set(MOTS2_SOURCES
./src/mots2/ConfigurationSettings.cpp
./src/mots2/STMContainer.cpp
./src/mots2/MTMContainer.cpp
./src/mots2/LTMContainer.cpp
./src/mots2/TabuSearch.cpp
./src/mots2/NimrodAdapter.cpp
)
source_group("MOTS2" FILES ${MOTS2_SOURCES})
set(MOTS2_HEADERS
./include/private/nimroda/mots2/ConfigurationSettings.hpp
./include/private/nimroda/mots2/STMContainer.hpp
./include/private/nimroda/mots2/MTMContainer.hpp
./include/private/nimroda/mots2/LTMContainer.hpp
./include/private/nimroda/mots2/TabuSearch.hpp
./include/private/nimroda/mots2/NimrodAdapter.hpp
)
source_group("MOTS2" FILES ${MOTS2_HEADERS})
set(NIMRODA_SOURCES
./src/always0.c
./src/point.c
./src/jna/jna.c
./src/jna/jna_dumpoptimargs.cpp
./src/nimroda.cpp
./src/nimroda_io.cpp
./src/algorithms.cpp
./nimroda.natvis
)
source_group("Source Files" FILES ${NIMRODA_SOURCES})
set(NIMRODA_FNV
./src/fnv/fnv.h
./src/fnv/hash_32.c
./src/fnv/hash_32a.c
./src/fnv/hash_64.c
./src/fnv/hash_64a.c
)
source_group("FNV" FILES ${NIMRODA_FNV})
set(NIMRODA_CXXAPI
./include/private/nimroda/cxx/Nimrod.hpp
./include/private/nimroda/cxx/Point.hpp
./include/private/nimroda/cxx/Batch.hpp
./include/private/nimroda/cxx/OptimStatus.hpp
./include/private/nimroda/cxx/CoordinateVector.hpp
./include/private/nimroda/cxx/PointDB.hpp
./include/private/nimroda/cxx/CIOContext.hpp
./src/cxx/Nimrod.cpp
./src/cxx/Point.cpp
./src/cxx/Batch.cpp
./src/cxx/OptimStatus.cpp
./src/cxx/PointDB.cpp
./src/cxx/CoordinateVector.cpp
./src/cxx/CIOContext.cpp
)
source_group("C++ API" FILES ${NIMRODA_CXXAPI})
set(NIMRODA_PRIVATE_HEADERS
./include/private/nimroda/nimroda_ip.h
./include/private/nimroda/algorithms.hpp
)
source_group("Header Files\\Private" FILES ${NIMRODA_PRIVATE_HEADERS})
set(NIMRODA_PUBLIC_HEADERS
./include/public/nimroda/nimroda.h
./include/public/nimroda/nimroda_p.h
./include/public/nimroda/config.h.in
${NIMRODA_GENERATED_INCLUDE_DIR}/nimroda/config.h
)
source_group("Header Files\\Public" FILES ${NIMRODA_PUBLIC_HEADERS})
add_library(nimroda ${NIMRODA_LIBRARY_TYPE}
${NIMRODA_SOURCES}
${NIMRODA_CXXAPI}
${NIMRODA_FNV}
${NIMRODA_PRIVATE_HEADERS}
${NIMRODA_PUBLIC_HEADERS}
${MOTS2_SOURCES}
${MOTS2_HEADERS}
)
# Link us with C/IO
target_link_libraries(nimroda cio)
target_include_directories(nimroda PRIVATE "include/private")
target_include_directories(nimroda PUBLIC "include/public")
target_include_directories(nimroda PUBLIC ${NIMRODA_GENERATED_INCLUDE_DIR})
set_target_properties(nimroda PROPERTIES
C_STANDARD 99
C_STANDARD_REQUIRED YES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
CMAKE_POSITION_INDEPENDENT_CODE ON
)
add_subdirectory(tester)