Browse Source

Rework a bit the base Cmakelist to make it clearer.

Godzil 4 years ago
parent
commit
77907499a4
1 changed files with 15 additions and 16 deletions
  1. 15 16
      CMakeLists.txt

+ 15 - 16
CMakeLists.txt

@@ -9,34 +9,33 @@ set(CMAKE_CXX_STANDARD 11)
 option(COVERALLS "Generate coveralls data" OFF)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/external/coveralls-cmake/cmake)
 
+option(PACKAGE_TESTS "Build the tests" ON)
+
+if (COVERALLS)
+    include(Coveralls)
+    coveralls_turn_on_coverage()
+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)
 
-
-if (COVERALLS)
-	include(Coveralls)
-	coveralls_turn_on_coverage()
-endif()
-
 # Main app
 add_subdirectory(source)
 
-
-option(PACKAGE_TESTS "Build the tests" ON)
 if(PACKAGE_TESTS OR COVERALLS)
     enable_testing()
     include(GoogleTest)
     add_subdirectory("${PROJECT_SOURCE_DIR}/external/googletest" "external/googletest")
     add_subdirectory(tests)
+endif()
 
-
-    if (COVERALLS)
-        # Create the coveralls target.
-        coveralls_setup(
-            "${COVERAGE_SRCS}" # The source files.
-            ON                 # If we should upload.
-        ) # (Optional) Alternate project cmake module path.
-    endif ()
+if (COVERALLS)    
+    # Create the coveralls target.
+    coveralls_setup(
+        "${COVERAGE_SRCS}" # The source files.
+        ON                 # If we should upload.
+    ) # (Optional) Alternate project cmake module path.
 endif()