diff --git a/CMakeLists.txt b/CMakeLists.txt index 6de17e793..882bd5b20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,71 +2,41 @@ cmake_minimum_required( VERSION 3.12 FATAL_ERROR ) project( GUNDAM ) +# necessary ? +include( CTest ) + # colored messages include( ${CMAKE_SOURCE_DIR}/cmake/utils/cmessage.cmake ) -cmessage(STATUS "Setting up CMake files...") - # define cmake options include( ${CMAKE_SOURCE_DIR}/cmake/options.cmake ) -include( ${CMAKE_SOURCE_DIR}/cmake/version.cmake ) -# ? -include( CTest ) - - -################################################################################ -# Check Dependencies -################################################################################ +# git version checking +include( ${CMAKE_SOURCE_DIR}/cmake/version.cmake ) +# checking dependencies include( ${CMAKE_SOURCE_DIR}/cmake/dependencies.cmake ) -include( ${CMAKE_SOURCE_DIR}/cmake/compiler.cmake ) -include( ${CMAKE_SOURCE_DIR}/cmake/submodules.cmake ) - -################################################################################ -# Specify Target Subdirs -################################################################################ -message("") -cmessage(STATUS "Defining modules...") - -set( MODULES Utils ) +# setup compiler options +include( ${CMAKE_SOURCE_DIR}/cmake/compiler.cmake ) -# Add the basic modules -list( APPEND MODULES DialDictionary) -list( APPEND MODULES ParametersManager) -list( APPEND MODULES SamplesManager) -list( APPEND MODULES DatasetManager) -list( APPEND MODULES Propagator) -list( APPEND MODULES Fitter) +# setting up submodule libraries +include( ${CMAKE_SOURCE_DIR}/cmake/submodules.cmake ) -if(WITH_CACHE_MANAGER) - list( APPEND MODULES CacheManager ) -endif() +# defining GUNDAM modules +include( ${CMAKE_SOURCE_DIR}/cmake/modules.cmake ) -foreach(mod ${MODULES}) - cmessage( STATUS "Adding cmake module: ${mod}" ) - add_subdirectory( ${CMAKE_SOURCE_DIR}/src/${mod} ) -endforeach() +# defining GUNDAM applications +include( ${CMAKE_SOURCE_DIR}/cmake/applications.cmake ) message("") -cmessage(STATUS "Defining applications...") - -add_subdirectory( ${CMAKE_SOURCE_DIR}/src/Applications ) -add_subdirectory( ${CMAKE_SOURCE_DIR}/tests ) - -configure_file(cmake/build_setup.sh.in - "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh" @ONLY) -install(FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh" - DESTINATION ${CMAKE_INSTALL_PREFIX}) - -cmessage( STATUS "Identified GUNDAM version: ${GUNDAM_VERSION_STRING}" ) +cmessage( WARNING "Identified GUNDAM version: ${GUNDAM_VERSION_STRING}+${GUNDAM_VERSION_POST_NB}-${GUNDAM_VERSION_POST_COMMIT}/${GUNDAM_VERSION_BRANCH}" ) # A command that works to compile gundam from any sub-directory. You # can get this aliased to "gundam-build" by sourcing # -# . "$(git rev-parse --show-toplevel)/cmake/gundam-setup.sh" +# . "$(git rev-parse --show-toplevel)/cmake/scripts/gundam-setup.sh" # # That runs: # Local Variables: diff --git a/Dockerfile b/Dockerfile index 1fc0f8e97..0ff74deea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ SHELL ["/bin/bash", "-c"] RUN apt-get dist-upgrade -y RUN apt-get update && apt-get upgrade -y -RUN apt-get install git libyaml-cpp-dev nlohmann-json3-dev -y +RUN apt-get install git libyaml-cpp-dev -y +RUN #apt-get install git libyaml-cpp-dev nlohmann-json3-dev -y ENV WORK_DIR /home/work ENV REPO_DIR $WORK_DIR/repo diff --git a/README.md b/README.md index 27e860c23..48709eeb7 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ a new release is available, simply use the same command. ```bash cd $REPO_DIR/gundam -cd cmake +cd cmake/scripts ./gundam-setup.sh ./gundam-build.sh ``` diff --git a/cmake/CMakeSetup.sh b/cmake/CMakeSetup.sh deleted file mode 100755 index 1fdeaae62..000000000 --- a/cmake/CMakeSetup.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -if [ "${1}" != "force" ] && hash cmake; then - CMAKEV=$(cmake --version | head -1 | sed "s/cmake version //") - echo "[INFO]: cmake version ${CMAKEV} lives at: $(which cmake)" - return 0 -fi - - -if [ ! "$XSLLHFITTER" ]; then - echo "[ERROR]: Please source setup.sh from the root of this package." - return 1 -fi - -if ! cd ${XSLLHFITTER}; then - echo "[ERROR]: Failed to cd to \${XSLLHFITTER}: ${XSLLHFITTER}" - return 1 -fi - -cd cmake; -if [ ! -e "CMAKE" ];then - echo "[INFO]: Checking out ND280 CMake..." - if [ ! ${CVSROOT} ]; then - echo "[ERROR]: Is CVS set up correctly? \${CVSROOT}: ${CVSROOT}" - return 1 - fi - if ! cvs co CMAKE; then - echo "[ERROR]: Failed. Is CVS set up correctly? \${CVSROOT}: ${CVSROOT}" - return 1 - fi -fi - -cd CMAKE; -CMAKEROOT=$(readlink -f .) -CMAKERELEASE=$(ls cmake-*.tar.gz | sed "s/^cmake-\(.*\)\.tar\.gz$/\1/") - -if [ ! -e "$(uname)/cmake-${CMAKERELEASE}" ]; then - mkdir -p $(uname) - cd $(uname) - tar -xzf ${CMAKEROOT}/cmake-${CMAKERELEASE}.tar.gz - cd cmake-${CMAKERELEASE} -else - cd $(uname)/cmake-${CMAKERELEASE} -fi - -if [ ! -e "bin/cmake" ]; then - ./bootstrap - if ! make; then - unset CMAKEROOT - unset CMAKERELEASE - return 1 - fi -fi - -CMAKEBIN=$(readlink -f bin) - -if ! [[ ":$PATH:" == *":${CMAKEBIN}:"* ]]; then - export PATH=${CMAKEBIN}:$PATH -fi - -CMAKEV=$(cmake --version | head -1 | sed "s/cmake version //") -echo "[INFO]: cmake version ${CMAKEV} lives at: $(which cmake)" - -unset CMAKEV -unset CMAKEROOT -unset CMAKERELEASE -unset CMAKEBIN - -return 0 diff --git a/cmake/applications.cmake b/cmake/applications.cmake new file mode 100644 index 000000000..a4b4f1f5a --- /dev/null +++ b/cmake/applications.cmake @@ -0,0 +1,12 @@ + +message("") +cmessage( WARNING "Defining applications...") + +add_subdirectory( ${CMAKE_SOURCE_DIR}/src/Applications ) +add_subdirectory( ${CMAKE_SOURCE_DIR}/tests ) + +configure_file(cmake/generated/build_setup.sh.in + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh" @ONLY) +install(FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh" + DESTINATION ${CMAKE_INSTALL_PREFIX}) + diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index ac4803145..75c7fd12f 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -1,7 +1,7 @@ message("") -cmessage(STATUS "Configuring compiler options...") +cmessage( WARNING "Configuring compiler options...") # Changes default install path to be a subdirectory of the build dir. # Should set the installation dir at configure time with @@ -28,7 +28,7 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" ) cmessage(FATAL_ERROR "Clang version must be at least 3.3" ) endif() else() - cmessage(WARNING "You are using an untested compiler." ) + cmessage( ALERT "You are using an untested compiler." ) endif() # CXX standard is required and must match the version ROOT was compiled with. @@ -48,7 +48,7 @@ elseif ( ROOT_cxx20_FOUND ) cmessage(STATUS "ROOT compiled with C++20") set(CMAKE_CXX_STANDARD 20) else ( ROOT_cxx14_FOUND ) - cmessage(WARNING "ROOT C++ standard not set, use ROOT minimum (C++14)") + cmessage( ALERT "ROOT C++ standard not set, use ROOT minimum (C++14)") set(CMAKE_CXX_STANDARD 14) endif ( ROOT_cxx14_FOUND) @@ -80,9 +80,9 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC -g") # CMake Generated ############################################################################### -cmessage (STATUS "C++ Compiler : ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") -cmessage (STATUS "C++ Standard : ${CMAKE_CXX_STANDARD}") -cmessage (STATUS "C++ Release flags : ${CMAKE_CXX_FLAGS_RELEASE}") -cmessage (STATUS "C++ Debug flags : ${CMAKE_CXX_FLAGS_DEBUG}") -cmessage (STATUS "Build type : ${CMAKE_BUILD_TYPE}") +cmessage( STATUS "C++ Compiler : ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) +cmessage( STATUS "C++ Standard : ${CMAKE_CXX_STANDARD}" ) +cmessage( STATUS "C++ Release flags : ${CMAKE_CXX_FLAGS_RELEASE}" ) +cmessage( STATUS "C++ Debug flags : ${CMAKE_CXX_FLAGS_DEBUG}" ) +cmessage( STATUS "Build type : ${CMAKE_BUILD_TYPE}" ) diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index a2d72b5ed..4e3a0ffd2 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -1,7 +1,26 @@ message("") -cmessage(STATUS "Checking dependencies...") +cmessage( WARNING "Checking dependencies...") + + +cmessage( STATUS "Looking for JSON install..." ) +find_package( nlohmann_json QUIET ) + +if( nlohmann_json_FOUND ) + cmessage( STATUS "nlohmann JSON library found.") + link_libraries( nlohmann_json::nlohmann_json ) +else() + cmessage( ALERT "nlohmann JSON library not found. Using fetch content... (CMake version >= 3.11)") + cmake_minimum_required( VERSION 3.11 FATAL_ERROR ) + include( FetchContent ) + + FetchContent_Declare( json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz ) + FetchContent_MakeAvailable( json ) + + include_directories( ${nlohmann_json_SOURCE_DIR}/include ) + cmessage( STATUS "nlohmann JSON library fetched: ${nlohmann_json_SOURCE_DIR}/include") +endif() ########## @@ -11,17 +30,22 @@ cmessage(STATUS "Checking dependencies...") #If you want to try an use the terminally buggy ROOT CMake scripts # ROOTConfig.cmake -> usually in /install/dir/of/root/6.26.06_2/share/root/cmake -cmessage( WARNING "Looking for ROOT install..." ) +cmessage( STATUS "Looking for ROOT install..." ) find_package( ROOT - REQUIRED COMPONENTS - Geom Physics Matrix MathCore Tree RIO - OPTIONAL_COMPONENTS + REQUIRED + COMPONENTS + Matrix + Tree Minuit2 + Physics + Matrix + MathCore + RIO ) if(ROOT_FOUND) - cmessage(STATUS "[ROOT]: ROOT found") + cmessage( STATUS "[ROOT]: ROOT found" ) include(${ROOT_USE_FILE}) # cmessage(STATUS "[ROOT]: ROOT packages found ${ROOT_LIBRARIES}") cmessage( STATUS "[ROOT]: ROOT include directory: ${ROOT_INCLUDE_DIRS}") @@ -99,30 +123,13 @@ endif(NOT ROOT_minuit2_FOUND) # NLOHMANN JSON #################### -find_package(nlohmann_json) - -if (nlohmann_json_FOUND) - cmessage( STATUS "nlohmann JSON library found") - # Additional actions for when the library is found -else() - # sometimes the header can be found in ROOT... - find_path(NLOHMANN_JSON_INCLUDE_DIR NAMES nlohmann/json.hpp) - - if (NLOHMANN_JSON_INCLUDE_DIR) - cmessage( STATUS "nlohmann JSON header found: ${NLOHMANN_JSON_INCLUDE_DIR}/nlohmann/json.hpp") - # Additional actions for when the library is found - else() - cmessage( FATAL_ERROR "nlohmann JSON library not found") - # Additional actions for when the library is not found - endif() -endif() #################### # YAML-CPP #################### -cmessage( WARNING "Looking for YAML install..." ) +cmessage( STATUS "Looking for YAML install..." ) find_package( yaml-cpp REQUIRED HINTS ${YAMLCPP_DIR} ) if(NOT yaml-cpp_FOUND) cmessage(FATAL_ERROR "yaml-cpp library not found.") @@ -133,8 +140,8 @@ cmessage( STATUS "yaml-cpp include directory: ${YAML_CPP_INCLUDE_DIR}") cmessage( STATUS "yaml-cpp lib: ${YAML_CPP_LIBRARIES}") if( "${YAML_CPP_INCLUDE_DIR} " STREQUAL " ") # WORKAROUND FOR CCLYON (old cmake version/pkg) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils ) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils ) + set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils ) + set( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils ) set(YAMLCPP_INSTALL_DIR ${YAMLCPP_DIR}) find_package( YAMLCPP REQUIRED ) if( NOT YAMLCPP_FOUND ) @@ -155,7 +162,7 @@ endif() # ZLIB (optional) #################### -cmessage( WARNING "Looking for optional ZLib install..." ) +cmessage( STATUS "Looking for optional ZLib install..." ) find_package(ZLIB) if (${ZLIB_FOUND}) cmessage( STATUS "ZLIB found : ${ZLIB_VERSION_STRING}") @@ -163,6 +170,7 @@ if (${ZLIB_FOUND}) cmessage( STATUS "ZLIB_LIBRARIES = ${ZLIB_LIBRARIES}") add_definitions( -D USE_ZLIB=1 ) else() + cmessage( WARNING "ZLib not found. Will compile without the associated features." ) add_definitions( -D USE_ZLIB=0 ) endif () @@ -191,9 +199,9 @@ if( ENABLE_CUDA ) endif() endif() cmessage( STATUS "CUDA compilation architectures: \"${CMAKE_CUDA_ARCHITECTURES}\"") - cmessage(WARNING "The \"--cache-manager\" option requires a GPU") + cmessage( ALERT "The \"--cache-manager\" option requires a GPU" ) else(CMAKE_CUDA_COMPILER) - cmessage(WARNING "CUDA not present -- Cache::Manager use the CPU") + cmessage( ALERT "CUDA not present -- Cache::Manager use the CPU") endif(CMAKE_CUDA_COMPILER) else( ENABLE_CUDA ) cmessage( ALERT "CUDA support disabled" ) diff --git a/cmake/VersionConfig.h.in b/cmake/generated/VersionConfig.h.in similarity index 100% rename from cmake/VersionConfig.h.in rename to cmake/generated/VersionConfig.h.in diff --git a/cmake/build_setup.sh.in b/cmake/generated/build_setup.sh.in similarity index 100% rename from cmake/build_setup.sh.in rename to cmake/generated/build_setup.sh.in diff --git a/cmake/modules.cmake b/cmake/modules.cmake new file mode 100644 index 000000000..339edf9c5 --- /dev/null +++ b/cmake/modules.cmake @@ -0,0 +1,22 @@ + +message("") +cmessage( WARNING "Defining modules...") + +set( MODULES Utils ) + +# Add the basic modules +list( APPEND MODULES DialDictionary) +list( APPEND MODULES ParametersManager) +list( APPEND MODULES SamplesManager) +list( APPEND MODULES DatasetManager) +list( APPEND MODULES Propagator) +list( APPEND MODULES Fitter) + +if(WITH_CACHE_MANAGER) + list( APPEND MODULES CacheManager ) +endif() + +foreach(mod ${MODULES}) + cmessage( STATUS "Adding cmake module: ${mod}" ) + add_subdirectory( ${CMAKE_SOURCE_DIR}/src/${mod} ) +endforeach() diff --git a/cmake/options.cmake b/cmake/options.cmake index d67f12bbd..0e286c56a 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -1,7 +1,7 @@ # CMake options message("") -cmessage(STATUS "Setting up options...") +cmessage( WARNING "Setting up options...") option( WITH_GUNDAM_ROOT_APP "Build app gundamRoot" ON ) option( WITH_CACHE_MANAGER "Enable compiling of the cache manager used by the GPU" ON ) @@ -34,17 +34,17 @@ if(BATCH_MODE) endif(BATCH_MODE) if (WITH_CACHE_MANAGER) - cmessage( WARNING "Enabling cache manager..." ) + cmessage( STATUS "Enabling cache manager..." ) add_definitions( -D GUNDAM_USING_CACHE_MANAGER ) # uncomment to enable the slow validations (NEVER during productions # or normal running). These are whole code validations and are # extremely slow. - if (CACHE_MANAGER_SLOW_VALIDATION) - cmessage( STATUS "Using slow validation for debugging" ) - cmessage(WARNING "Using slow validation so runs will be very slow" ) - add_definitions( -DCACHE_MANAGER_SLOW_VALIDATION) - endif (CACHE_MANAGER_SLOW_VALIDATION) + if( CACHE_MANAGER_SLOW_VALIDATION ) + cmessage( STATUS " Using slow validation for debugging" ) + cmessage( STATUS " Using slow validation so runs will be very slow" ) + add_definitions( -D CACHE_MANAGER_SLOW_VALIDATION ) + endif( CACHE_MANAGER_SLOW_VALIDATION ) cmessage( STATUS "Cache manager is enabled. GPU support can be enabled using ENABLE_CUDA option." ) else() diff --git a/cmake/gundam-build.sh b/cmake/scripts/gundam-build.sh similarity index 100% rename from cmake/gundam-build.sh rename to cmake/scripts/gundam-build.sh diff --git a/cmake/gundam-setup.sh b/cmake/scripts/gundam-setup.sh similarity index 90% rename from cmake/gundam-setup.sh rename to cmake/scripts/gundam-setup.sh index 40e8657c7..ed660c19d 100755 --- a/cmake/gundam-setup.sh +++ b/cmake/scripts/gundam-setup.sh @@ -4,7 +4,7 @@ # running the test). This makes sure that the ROOT environment # variables are set (using thisroot.sh) since that helps debugging. # -# gundam-build == Source ./build/gundam-build.sh which will conveniently +# gundam-build == Source ./cmake/scripts/gundam-build.sh which will conveniently # run cmake/make/make install from any place so that it's # really easy to recompile. # @@ -36,7 +36,7 @@ fi ___gundam_root() { COUNT=5 while true; do - if [ -e ./cmake -a -d ./cmake -a -e ./cmake/gundam-build.sh ]; then + if [ -e ./cmake -a -d ./cmake -a -e ./cmake/scripts/gundam-build.sh ]; then echo ${PWD} return fi @@ -95,8 +95,8 @@ ___path_prepend LD_LIBRARY_PATH ${GUNDAM_ROOT}/${GUNDAM_TARGET}/lib unset -f ___path_prepend unset -f ___path_remove -alias gundam-setup=". ${GUNDAM_ROOT}/cmake/gundam-setup.sh" -alias gundam-build="${GUNDAM_ROOT}/cmake/gundam-build.sh" +alias gundam-setup=". ${GUNDAM_ROOT}/cmake/scripts/gundam-setup.sh" +alias gundam-build="${GUNDAM_ROOT}/cmake/scripts/gundam-build.sh" echo Source code: ${GUNDAM_ROOT} echo Build target: ${GUNDAM_TARGET} diff --git a/cmake/submodules.cmake b/cmake/submodules.cmake index 0c4f431be..a5d18f4b1 100644 --- a/cmake/submodules.cmake +++ b/cmake/submodules.cmake @@ -2,12 +2,12 @@ # SubModules: These are just adding the code directly, as stand-alone projects. message("") -cmessage(STATUS "Checking submodules...") +cmessage( WARNING "Checking submodules..." ) function( checkSubmodule ) list( GET ARGV 0 SELECTED_SUBMODULE ) - cmessage( WARNING "Checking submodule: ${SELECTED_SUBMODULE}" ) + cmessage( STATUS "Checking submodule: ${SELECTED_SUBMODULE}" ) file( GLOB FILES_IN_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/submodules/${SELECTED_SUBMODULE}/*") @@ -40,7 +40,7 @@ include_directories(submodules/cpp-generic-toolbox/include) #install(FILES ${CPP_GENERIC_TOOLBOX_HEADERS} DESTINATION include) #install(FILES ${CPP_GENERIC_TOOLBOX_HEADERS_IMPL} DESTINATION include/implementation) -add_definitions( -D PROGRESS_BAR_FILL_TAG="\\\"T2K\#"\\\" ) +add_definitions( -D PROGRESS_BAR_FILL_TAG="\\\"GUNDAM\#"\\\" ) if (COLOR_OUTPUT) add_definitions( -D PROGRESS_BAR_ENABLE_RAINBOW=1 ) else (COLOR_OUTPUT) diff --git a/cmake/utils/GenROOTDictionary.cmake b/cmake/utils/GenROOTDictionary.cmake index 8407807a2..e14e4b4b2 100644 --- a/cmake/utils/GenROOTDictionary.cmake +++ b/cmake/utils/GenROOTDictionary.cmake @@ -6,7 +6,7 @@ function(ROOT_GENERATE_DICTIONARY OutputDictName Header LINKDEFDUMMY LinkDef) string(REPLACE " " ";" LISTCPPFLAGS "${CMAKE_CXX_FLAGS}") #ROOT5 CINT cannot handle it. - list(REMOVE_ITEM LISTCPPFLAGS "-std=c++11") + list(REMOVE_ITEM LISTCPPFLAGS "-std=c++14") cmessage( STATUS "ROOTDICTGEN -- LISTCPPFLAGS: ${LISTCPPFLAGS}") cmessage( STATUS "ROOTDICTGEN -- LISTINCLUDES: ${LISTDIRINCLUDES}") diff --git a/cmake/git-version.cmake b/cmake/utils/git-version.cmake similarity index 95% rename from cmake/git-version.cmake rename to cmake/utils/git-version.cmake index 4de91c8fb..e9d839c92 100644 --- a/cmake/git-version.cmake +++ b/cmake/utils/git-version.cmake @@ -90,6 +90,6 @@ doVersionCheck() ##################### cmessage( STATUS "Generating version config header: ${GENERATE_DIR_FOR_VERSION_CHECK}/generated/VersionConfig.h" ) -configure_file( ${CMAKE_SOURCE_DIR}/cmake/VersionConfig.h.in ${GENERATE_DIR_FOR_VERSION_CHECK}/generated/VersionConfig.h ) +configure_file( ${CMAKE_SOURCE_DIR}/cmake/generated/VersionConfig.h.in ${GENERATE_DIR_FOR_VERSION_CHECK}/generated/VersionConfig.h ) diff --git a/cmake/version.cmake b/cmake/version.cmake index a041a0064..602d1b0ac 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -1,15 +1,15 @@ message("") -cmessage(STATUS "Checking out git version...") +cmessage( WARNING "Checking out git version...") # Printout version & generate header -cmessage( WARNING "Pre-checking GUNDAM version" ) +cmessage( STATUS "Pre-checking GUNDAM version" ) set(GENERATE_DIR_FOR_VERSION_CHECK ${CMAKE_BINARY_DIR} CACHE STRING "GENERATE_DIR_FOR_VERSION_CHECK") add_custom_target( preBuildVersionCheck - COMMAND ${CMAKE_COMMAND} -D GENERATE_DIR_FOR_VERSION_CHECK=${GENERATE_DIR_FOR_VERSION_CHECK} -P ${CMAKE_SOURCE_DIR}/cmake/git-version.cmake + COMMAND ${CMAKE_COMMAND} -D GENERATE_DIR_FOR_VERSION_CHECK=${GENERATE_DIR_FOR_VERSION_CHECK} -P ${CMAKE_SOURCE_DIR}/cmake/utils/git-version.cmake COMMENT "Checking GUNDAM version with git files..." WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) # Run the command while building makefiles -include( ${CMAKE_SOURCE_DIR}/cmake/git-version.cmake ) +include( ${CMAKE_SOURCE_DIR}/cmake/utils/git-version.cmake )