modify CMakeLists.txt

This commit is contained in:
an-tao 2018-06-15 09:44:40 +08:00
parent 7d8f1ec7fa
commit fd4f43816a
2 changed files with 10 additions and 9 deletions

View File

@ -76,25 +76,26 @@ install(TARGETS drogon DESTINATION lib)
file(GLOB trantor_net_headers "${CMAKE_CURRENT_SOURCE_DIR}/lib/inc/drogon/*.h")
install(FILES ${trantor_net_headers} DESTINATION include/drogon)
file(WRITE "./config.h" "const char definitions[]=\"")
SET(CONFIG_HEADER "${PROJECT_SOURCE_DIR}/config.h")
file(WRITE "${CONFIG_HEADER}" "const char definitions[]=\"")
add_dependencies(drogon trantor)
add_dependencies(drogon makeVersion)
get_directory_property(DEFS COMPILE_DEFINITIONS)
foreach(loop_var ${DEFS})
#message(STATUS "definitions " ${loop_var})
file(APPEND "./config.h" "-D" ${loop_var} " ")
file(APPEND "${CONFIG_HEADER}" "-D" ${loop_var} " ")
endforeach(loop_var)
file(APPEND "./config.h" "\";")
file(APPEND "./config.h" "\n" "const char compileFlags[]=\"" ${CMAKE_CXX_FLAGS} "\";")
file(APPEND "${CONFIG_HEADER}" "\";")
file(APPEND "${CONFIG_HEADER}" "\n" "const char compileFlags[]=\"" ${CMAKE_CXX_FLAGS} "\";")
get_target_property(INS drogon INCLUDE_DIRECTORIES)
file(APPEND "./config.h" "\nconst char includeDirs[]=\"")
file(APPEND "${CONFIG_HEADER}" "\nconst char includeDirs[]=\"")
foreach(loop_var ${INS})
file(APPEND "./config.h" "-I" ${loop_var} " ")
file(APPEND "${CONFIG_HEADER}" "-I" ${loop_var} " ")
endforeach(loop_var)
file(APPEND "./config.h" "\";\n")
EXEC_PROGRAM(${PROJECT_SOURCE_DIR}/update_config.sh ARGS "${PROJECT_SOURCE_DIR}/config.h ${PROJECT_SOURCE_DIR}/lib/inc/drogon/config.h")
file(APPEND "${CONFIG_HEADER}" "\";\n")
EXEC_PROGRAM(${PROJECT_SOURCE_DIR}/update_config.sh ARGS "${CONFIG_HEADER} ${PROJECT_SOURCE_DIR}/lib/inc/drogon/config.h")
if (MAKETEST STREQUAL YES)
ADD_SUBDIRECTORY(tests)

View File

@ -105,7 +105,7 @@ void SharedLibManager::managerLibs()
else
return;
}
{
std::ofstream fout(lockFile);
}