Rework a bit the base Cmakelist to make it clearer.
This commit is contained in:
@@ -9,34 +9,33 @@ set(CMAKE_CXX_STANDARD 11)
|
|||||||
option(COVERALLS "Generate coveralls data" OFF)
|
option(COVERALLS "Generate coveralls data" OFF)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/external/coveralls-cmake/cmake)
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/external/coveralls-cmake/cmake)
|
||||||
|
|
||||||
# LodePNG don't make a .a or .so, so let's build a library here
|
option(PACKAGE_TESTS "Build the tests" ON)
|
||||||
add_library(LodePNG STATIC)
|
|
||||||
set(LODEPNG_INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/external/lodepng)
|
|
||||||
target_sources(LodePNG PRIVATE external/lodepng/lodepng.cpp external/lodepng/lodepng.h)
|
|
||||||
|
|
||||||
|
|
||||||
if (COVERALLS)
|
if (COVERALLS)
|
||||||
include(Coveralls)
|
include(Coveralls)
|
||||||
coveralls_turn_on_coverage()
|
coveralls_turn_on_coverage()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# LodePNG don't make a .a or .so, so let's build a library here
|
||||||
|
add_library(LodePNG STATIC)
|
||||||
|
set(LODEPNG_INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/external/lodepng)
|
||||||
|
target_sources(LodePNG PRIVATE external/lodepng/lodepng.cpp external/lodepng/lodepng.h)
|
||||||
|
|
||||||
# Main app
|
# Main app
|
||||||
add_subdirectory(source)
|
add_subdirectory(source)
|
||||||
|
|
||||||
|
|
||||||
option(PACKAGE_TESTS "Build the tests" ON)
|
|
||||||
if(PACKAGE_TESTS OR COVERALLS)
|
if(PACKAGE_TESTS OR COVERALLS)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
add_subdirectory("${PROJECT_SOURCE_DIR}/external/googletest" "external/googletest")
|
add_subdirectory("${PROJECT_SOURCE_DIR}/external/googletest" "external/googletest")
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (COVERALLS)
|
||||||
if (COVERALLS)
|
|
||||||
# Create the coveralls target.
|
# Create the coveralls target.
|
||||||
coveralls_setup(
|
coveralls_setup(
|
||||||
"${COVERAGE_SRCS}" # The source files.
|
"${COVERAGE_SRCS}" # The source files.
|
||||||
ON # If we should upload.
|
ON # If we should upload.
|
||||||
) # (Optional) Alternate project cmake module path.
|
) # (Optional) Alternate project cmake module path.
|
||||||
endif ()
|
|
||||||
endif()
|
endif()
|
||||||
Reference in New Issue
Block a user