|
@@ -1,5 +1,5 @@
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|
|
-PROJECT(PARADEVS_TEST CXX C)
|
|
|
+PROJECT(ARTIS_TEST CXX C)
|
|
|
ENABLE_TESTING()
|
|
|
|
|
|
SET(MODEL_MAJOR 0)
|
|
@@ -8,49 +8,60 @@ SET(MODEL_PATCH 0)
|
|
|
SET(MODEL_EXTRA "-dev")
|
|
|
|
|
|
IF ("${MODEL_EXTRA}" STREQUAL "")
|
|
|
- SET(MODEL_NAME "${PROJECT_NAME}-${MODEL_MAJOR}.${MODEL_MINOR}.${MODEL_PATCH}")
|
|
|
+ SET(MODEL_NAME "${PROJECT_NAME}-${MODEL_MAJOR}.${MODEL_MINOR}.${MODEL_PATCH}")
|
|
|
ELSE ("${MODEL_EXTRA}" STREQUAL "")
|
|
|
- SET(MODEL_NAME "${PROJECT_NAME}-${MODEL_MAJOR}.${MODEL_MINOR}.${MODEL_PATCH}${MODEL_EXTRA}")
|
|
|
+ SET(MODEL_NAME "${PROJECT_NAME}-${MODEL_MAJOR}.${MODEL_MINOR}.${MODEL_PATCH}${MODEL_EXTRA}")
|
|
|
ENDIF ("${MODEL_EXTRA}" STREQUAL "")
|
|
|
|
|
|
#
|
|
|
- # CPack configuration
|
|
|
+# CPack configuration
|
|
|
#
|
|
|
|
|
|
INCLUDE(CMakeCPack.cmake)
|
|
|
|
|
|
#
|
|
|
- # Debug mode
|
|
|
+# Debug mode
|
|
|
#
|
|
|
|
|
|
IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR
|
|
|
- ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
|
|
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
|
|
|
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -Wall -Wextra -std=c++11")
|
|
|
- IF (UNIX)
|
|
|
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
|
|
|
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
|
|
|
- ENDIF (UNIX)
|
|
|
+ ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
|
|
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
|
|
|
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -Wall -Wextra -std=c++11")
|
|
|
+ IF (UNIX)
|
|
|
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
|
|
|
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
|
|
|
+ ENDIF (UNIX)
|
|
|
ENDIF ()
|
|
|
|
|
|
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
+ add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
|
|
|
+ add_link_options(-fprofile-instr-generate)
|
|
|
+ #Uncomment in case of linker errors
|
|
|
+ #link_libraries(clang_rt.profile-x86_64)
|
|
|
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
|
+ add_compile_options(--coverage)
|
|
|
+ #Uncomment in case of linker errors
|
|
|
+ link_libraries(gcov)
|
|
|
+endif ()
|
|
|
+
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "")
|
|
|
- SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build" FORCE)
|
|
|
+ SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build" FORCE)
|
|
|
endif ()
|
|
|
|
|
|
#
|
|
|
- # Thread
|
|
|
+# Thread
|
|
|
#
|
|
|
|
|
|
message(STATUS "checking for a (p)thread library")
|
|
|
find_package(Threads REQUIRED)
|
|
|
if (NOT Threads_FOUND)
|
|
|
- message(ERROR " failed to found a (p)thread support.")
|
|
|
+ message(ERROR " failed to found a (p)thread support.")
|
|
|
else ()
|
|
|
- message(STATUS " threads support enabled (${CMAKE_THREAD_LIBS_INIT})")
|
|
|
+ message(STATUS " threads support enabled (${CMAKE_THREAD_LIBS_INIT})")
|
|
|
endif ()
|
|
|
|
|
|
#
|
|
|
- # Modules
|
|
|
+# Modules
|
|
|
#
|
|
|
|
|
|
INCLUDE(CheckIncludeFileCXX)
|
|
@@ -59,21 +70,15 @@ INCLUDE(CheckLibraryExists)
|
|
|
INCLUDE(CMakeDetermineCCompiler)
|
|
|
|
|
|
#
|
|
|
- # Check libraries with pkgconfig
|
|
|
+# Check libraries with pkgconfig
|
|
|
#
|
|
|
|
|
|
FIND_PACKAGE(PkgConfig REQUIRED)
|
|
|
|
|
|
-# FIXME use old-style link directories for now
|
|
|
-IF (COMMAND CMAKE_POLICY)
|
|
|
- CMAKE_POLICY(SET CMP0003 OLD)
|
|
|
-ENDIF (COMMAND CMAKE_POLICY)
|
|
|
-
|
|
|
-PKG_CHECK_MODULES(PARADEVS REQUIRED paradevs-1.0)
|
|
|
-PKG_CHECK_MODULES(LIBXML REQUIRED libxml-2.0)
|
|
|
+PKG_CHECK_MODULES(ARTIS REQUIRED artis-star-1.0)
|
|
|
|
|
|
#
|
|
|
- # Test the libboost header and libboost-text library.
|
|
|
+# Test the libboost header and libboost-text library.
|
|
|
#
|
|
|
|
|
|
OPTION(WITH_TEST "use the libboost test unit library [default: on]" ON)
|
|
@@ -82,62 +87,59 @@ SET(Boost_USE_STATIC_LIBS OFF)
|
|
|
SET(Boost_NO_SYSTEM_PATHS OFF)
|
|
|
SET(Boost_USE_STATIC_RUNTIME ON)
|
|
|
IF (WIN32)
|
|
|
- SET(Boost_THREADAPI "win32")
|
|
|
+ SET(Boost_THREADAPI "win32")
|
|
|
ENDIF (WIN32)
|
|
|
|
|
|
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
- ${CMAKE_BINARY_DIR})
|
|
|
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR})
|
|
|
|
|
|
find_package(MPI REQUIRED)
|
|
|
if (NOT MPI_CXX_FOUND)
|
|
|
- message(ERROR " failed to found a C++ compiler with MPI support.")
|
|
|
-else()
|
|
|
- message(STATUS " MPI support enabled")
|
|
|
- include_directories(${MPI_CXX_INCLUDE_PATH})
|
|
|
+ message(ERROR " failed to found a C++ compiler with MPI support.")
|
|
|
+else ()
|
|
|
+ message(STATUS " MPI support enabled")
|
|
|
+ include_directories(${MPI_CXX_INCLUDE_PATH})
|
|
|
endif ()
|
|
|
|
|
|
message(STATUS "checking for Boost headers and libraries")
|
|
|
find_package(Boost 1.55 REQUIRED COMPONENTS graph mpi timer serialization
|
|
|
- system)
|
|
|
+ system)
|
|
|
if (NOT Boost_FOUND)
|
|
|
- MESSAGE(FATAL_ERROR "The boost graph library is required")
|
|
|
+ MESSAGE(FATAL_ERROR "The boost graph library is required")
|
|
|
else ()
|
|
|
- message(STATUS " Boost found")
|
|
|
- include_directories(${Boost_INCLUDE_DIRS})
|
|
|
- link_directories(${Boost_LIBRARY_DIRS})
|
|
|
+ message(STATUS " Boost found")
|
|
|
+ include_directories(${Boost_INCLUDE_DIRS})
|
|
|
+ link_directories(${Boost_LIBRARY_DIRS})
|
|
|
endif ()
|
|
|
|
|
|
#
|
|
|
- # Generate the config.h
|
|
|
+# Generate the config.h
|
|
|
#
|
|
|
|
|
|
-CHECK_INCLUDE_FILE_CXX(cxxabi.h PARADEVS_HAVE_GCC_ABI_DEMANGLE)
|
|
|
-CHECK_INCLUDE_FILE_CXX(execinfo.h PARADEVS_HAVE_EXECINFO)
|
|
|
-CHECK_INCLUDE_FILE_CXX(signal.h PARADEVS_HAVE_SIGNAL)
|
|
|
+CHECK_INCLUDE_FILE_CXX(cxxabi.h ARTIS_HAVE_GCC_ABI_DEMANGLE)
|
|
|
+CHECK_INCLUDE_FILE_CXX(execinfo.h ARTIS_HAVE_EXECINFO)
|
|
|
+CHECK_INCLUDE_FILE_CXX(signal.h ARTIS_HAVE_SIGNAL)
|
|
|
|
|
|
#
|
|
|
- # Browse the src subdirectory
|
|
|
+# Browse the src subdirectory
|
|
|
#
|
|
|
|
|
|
ADD_SUBDIRECTORY(src)
|
|
|
|
|
|
#
|
|
|
- # Status
|
|
|
+# Status
|
|
|
#
|
|
|
|
|
|
MESSAGE(STATUS "- - - -")
|
|
|
-MESSAGE(STATUS "${PARADEVS_NAME_COMPLETE} configured successfully")
|
|
|
+MESSAGE(STATUS "${ARTIS_NAME_COMPLETE} configured successfully")
|
|
|
MESSAGE(STATUS "Using ${CMAKE_INSTALL_PREFIX} for installation")
|
|
|
MESSAGE(STATUS "Build type ${CMAKE_BUILD_TYPE}")
|
|
|
-IF (PARADEVS_HAVE_GCC_ABI_DEMANGLE)
|
|
|
- MESSAGE(STATUS "Build with GCC ABI Demangle...: yes")
|
|
|
-ENDIF (PARADEVS_HAVE_GCC_ABI_DEMANGLE)
|
|
|
-IF (PARADEVS_HAVE_EXECINFO)
|
|
|
- MESSAGE(STATUS "Build with execinfo.h.........: yes")
|
|
|
-ENDIF (PARADEVS_HAVE_EXECINFO)
|
|
|
+IF (ARTIS_HAVE_GCC_ABI_DEMANGLE)
|
|
|
+ MESSAGE(STATUS "Build with GCC ABI Demangle...: yes")
|
|
|
+ENDIF (ARTIS_HAVE_GCC_ABI_DEMANGLE)
|
|
|
+IF (ARTIS_HAVE_EXECINFO)
|
|
|
+ MESSAGE(STATUS "Build with execinfo.h.........: yes")
|
|
|
+ENDIF (ARTIS_HAVE_EXECINFO)
|
|
|
IF (Boost_FOUND)
|
|
|
- MESSAGE(STATUS "Build with boost..............: yes")
|
|
|
+ MESSAGE(STATUS "Build with boost..............: yes")
|
|
|
ENDIF (Boost_FOUND)
|
|
|
-MESSAGE(STATUS "- - - -")
|
|
|
-
|
|
|
-# vim:tw=0:ts=8:tw=0:sw=2:sts=2
|
|
|
+MESSAGE(STATUS "- - - -")
|