Skip to content

Commit

Permalink
Tests and examples compilation are now optional, to activate it
Browse files Browse the repository at this point in the history
    use:

    cmake -DFPL_ENABLE_TESTS=ON -DFPL_ENABLE_EXAMPLES=ON $SOURCE_DIR

    First aproach (but not a real solution) to solve issue #16
  • Loading branch information
femparadmin committed May 23, 2016
1 parent 17a3d35 commit 9416606
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ install:
before_script:
- mkdir build
- cd build
- cmake ..
- cmake -DFPL_ENABLE_TESTS=ON -DFPL_ENABLE_EXAMPLES=ON ..

script:
- ctest -VV -T Start -T Build -T Test -T Coverage
Expand Down
19 changes: 16 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SET(THIRDPARTY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/thirdparty)
INCLUDE_DIRECTORIES(${CMAKE_Fortran_MODULE_DIRECTORY})

#################################################################
# CONFIGURATION TYPES & BUILD MODE
# CONFIGURATION TYPES & BUILD MODE & BUILD_TESTS
#################################################################

SET(CMAKE_CONFIGURATION_TYPES DEBUG RELEASE)
Expand All @@ -45,6 +45,14 @@ IF(NOT CMAKE_BUILD_TYPE)
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS NONE DEBUG RELEASE)
ENDIF(NOT CMAKE_BUILD_TYPE)

IF(NOT ${PROJECT_NAME}_ENABLE_TESTS)
OPTION(${PROJECT_NAME}_ENABLE_TESTS "Enable/disable tests compilation" OFF)
ENDIF(NOT ${PROJECT_NAME}_ENABLE_TESTS)

IF(NOT ${PROJECT_NAME}_ENABLE_EXAMPLES)
OPTION(${PROJECT_NAME}_ENABLE_EXAMPLES "Enable/disable examples compilation" OFF)
ENDIF(NOT ${PROJECT_NAME}_ENABLE_EXAMPLES)

#################################################################
# List of external libraries
#################################################################
Expand Down Expand Up @@ -167,6 +175,11 @@ ENDIF()
#################################################################

ADD_SUBDIRECTORY(${LIB_PATH})
ADD_SUBDIRECTORY(${TESTS_PATH})
ADD_SUBDIRECTORY(${EXAMPLES_PATH})
IF(${PROJECT_NAME}_ENABLE_TESTS)
ADD_SUBDIRECTORY(${TESTS_PATH})
ENDIF()

IF(${PROJECT_NAME}_ENABLE_EXAMPLES)
ADD_SUBDIRECTORY(${EXAMPLES_PATH})
ENDIF()

0 comments on commit 9416606

Please sign in to comment.