# If we're not crosscompiling, we check by executing the program:
if (HAVE_SEM_OPEN AND NOT CMAKE_CROSSCOMPILING)
execute_process(COMMAND ./sem_open
# If we're not crosscompiling, we check by executing the program:
if (HAVE_SEM_OPEN AND NOT CMAKE_CROSSCOMPILING)
execute_process(COMMAND ./sem_open
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- RESULT_VARIABLE HAVE_SEM_OPEN_run
- OUTPUT_VARIABLE var_compil
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ RESULT_VARIABLE HAVE_SEM_OPEN_run
+ OUTPUT_VARIABLE var_compil
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- RESULT_VARIABLE HAVE_SEM_INIT_run OUTPUT_VARIABLE HAVE_SEM_INIT_compil)
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ RESULT_VARIABLE HAVE_SEM_INIT_run
+ OUTPUT_VARIABLE HAVE_SEM_INIT_compil)
# If we're not crosscompiling, we check by executing the program:
if (HAVE_SEM_INIT AND NOT CMAKE_CROSSCOMPILING)
execute_process(COMMAND ./sem_init
# If we're not crosscompiling, we check by executing the program:
if (HAVE_SEM_INIT AND NOT CMAKE_CROSSCOMPILING)
execute_process(COMMAND ./sem_init
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- RESULT_VARIABLE HAVE_SEM_INIT_run
- OUTPUT_VARIABLE var_compil
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ RESULT_VARIABLE HAVE_SEM_INIT_run
+ OUTPUT_VARIABLE var_compil
- execute_process(COMMAND git remote
- COMMAND head -n 1
- WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
- OUTPUT_VARIABLE remote
- RESULT_VARIABLE ret
- )
- string(REPLACE "\n" "" remote "${remote}")
+ execute_process(
+ COMMAND git remote
+ COMMAND head -n 1
+ WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
+ OUTPUT_VARIABLE remote
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
#message(STATUS "Git remote: ${remote}")
execute_process(COMMAND git config --get remote.${remote}.url
#message(STATUS "Git remote: ${remote}")
execute_process(COMMAND git config --get remote.${remote}.url
#message(STATUS "Git url: ${url}")
if(url)
execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=oneline --abbrev-commit -1
#message(STATUS "Git url: ${url}")
if(url)
execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=oneline --abbrev-commit -1
- WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
- OUTPUT_VARIABLE GIT_VERSION
- RESULT_VARIABLE ret
- )
- string(REPLACE "\n" "" GIT_VERSION "${GIT_VERSION}")
+ WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
+ OUTPUT_VARIABLE GIT_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
- WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
- OUTPUT_VARIABLE GIT_DATE
- RESULT_VARIABLE ret
- )
- string(REPLACE "\n" "" GIT_DATE "${GIT_DATE}")
+ WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
+ OUTPUT_VARIABLE GIT_DATE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Git date: ${GIT_DATE}")
string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=format:%H -1
message(STATUS "Git date: ${GIT_DATE}")
string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=format:%H -1
- WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
- OUTPUT_VARIABLE SIMGRID_GITHASH
- RESULT_VARIABLE ret
- )
- string(REPLACE "\n" "" SIMGRID_GITHASH "${SIMGRID_GITHASH}")
-
+ WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
+ OUTPUT_VARIABLE SIMGRID_GITHASH
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion)
FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION)
endif()
elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion)
FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION)
# Avoid triggering a (full) rebuild by touching the files if they did not really change
configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE)
configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated" @ONLY IMMEDIATE)
# Avoid triggering a (full) rebuild by touching the files if they did not really change
configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE)
configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated" @ONLY IMMEDIATE)
-exec_program("${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h")
-exec_program("${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid_config.h")
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h)
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid_config.h)
file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated)
file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated)
file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated)
file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated)
file(WRITE ${PROJECT_BINARY_DIR}/Testing/Notes/Build "GIT version : ${GIT_VERSION}\n")
file(APPEND ${PROJECT_BINARY_DIR}/Testing/Notes/Build "Release : simgrid-${release_version}\n")
file(WRITE ${PROJECT_BINARY_DIR}/Testing/Notes/Build "GIT version : ${GIT_VERSION}\n")
file(APPEND ${PROJECT_BINARY_DIR}/Testing/Notes/Build "Release : simgrid-${release_version}\n")