diff options
author | Jacob Champion <jchampion@apache.org> | 2016-07-12 21:13:36 +0200 |
---|---|---|
committer | Jacob Champion <jchampion@apache.org> | 2016-07-12 21:13:36 +0200 |
commit | 852d9364e4c0f06c271b59d2d22ff11e30f3458a (patch) | |
tree | fbc42ba98c0c9054b158f3e3da8be1c3693b6e76 /CMakeLists.txt | |
parent | CMake: use CMAKE_REQUIRED_INCLUDES to find APR macros (diff) | |
download | apache2-852d9364e4c0f06c271b59d2d22ff11e30f3458a.tar.xz apache2-852d9364e4c0f06c271b59d2d22ff11e30f3458a.zip |
CMake: use generator expressions to find output files
Multi-configuration generators, like Visual Studio, use a different
output directory (Debug, Release, etc.) for each configuration. To find
the output files reliably, switch to using generator expressions instead
of hardcoding the file paths for PDBs, export files, etc.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1752332 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9928fa0f2a..fd81e91c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -765,12 +765,12 @@ FOREACH (mod ${MODULE_PATHS}) SET(all_mod_sources ${tmp_mod_main_source} ${${mod_extra_sources}}) ADD_LIBRARY(${mod_name} SHARED ${all_mod_sources} build/win32/httpd.rc) SET(install_modules ${install_modules} ${mod_name}) - SET(install_modules_pdb ${install_modules_pdb} "${PROJECT_BINARY_DIR}/${mod_name}.pdb") + SET(install_modules_pdb ${install_modules_pdb} "$<TARGET_PDB_FILE:${mod_name}>") IF("${${mod_name}_install_lib}") SET(installed_mod_libs_exps ${installed_mod_libs_exps} - "${PROJECT_BINARY_DIR}/${mod_name}.lib" - "${PROJECT_BINARY_DIR}/${mod_name}.exp" + "$<TARGET_LINKER_FILE:${mod_name}>" + "$<TARGET_LINKER_FILE_DIR:${mod_name}>/${mod_name}.exp" ) ENDIF() SET(mod_extra_libs "${mod_name}_extra_libs") @@ -805,7 +805,7 @@ SET_TARGET_PROPERTIES(libhttpd PROPERTIES LINK_FLAGS /base:@${PROJECT_BINARY_DIR}/BaseAddr.ref,libhttpd.dll ) SET(install_targets ${install_targets} libhttpd) -SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libhttpd.pdb) +SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:libhttpd>) TARGET_LINK_LIBRARIES(libhttpd ${EXTRA_LIBS} ${APR_LIBRARIES} ${PCRE_LIBRARIES} ${HTTPD_SYSTEM_LIBS}) DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server Core") SET_TARGET_PROPERTIES(libhttpd PROPERTIES COMPILE_FLAGS "-DAP_DECLARE_EXPORT -DAPREQ_DECLARE_EXPORT ${define_long_name} -DBIN_NAME=libhttpd.dll ${EXTRA_COMPILE_FLAGS}") @@ -814,7 +814,7 @@ ADD_DEPENDENCIES(libhttpd test_char_header) ########### HTTPD EXECUTABLES ########## ADD_EXECUTABLE(httpd server/main.c build/win32/httpd.rc) SET(install_targets ${install_targets} httpd) -SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/httpd.pdb) +SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:httpd>) DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server") SET_TARGET_PROPERTIES(httpd PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=httpd.exe -DICON_FILE=${CMAKE_SOURCE_DIR}/build/win32/apache.ico ${EXTRA_COMPILE_FLAGS}") TARGET_LINK_LIBRARIES(httpd libhttpd ${EXTRA_LIBS}) @@ -837,7 +837,7 @@ FOREACH(pgm ${standard_support}) SET(extra_sources ${pgm}_extra_sources) ADD_EXECUTABLE(${pgm} support/${pgm}.c ${${extra_sources}} build/win32/httpd.rc) SET(install_targets ${install_targets} ${pgm}) - SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/${pgm}.pdb) + SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:${pgm}>) DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server ${pgm} program") SET_TARGET_PROPERTIES(${pgm} PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=${pgm}.exe ${EXTRA_COMPILE_FLAGS}") TARGET_LINK_LIBRARIES(${pgm} ${EXTRA_LIBS} ${APR_LIBRARIES}) @@ -846,7 +846,7 @@ ENDFOREACH() IF(OPENSSL_FOUND) ADD_EXECUTABLE(abs support/ab.c build/win32/httpd.rc) SET(install_targets ${install_targets} abs) - SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/abs.pdb) + SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:abs>) SET_TARGET_PROPERTIES(abs PROPERTIES COMPILE_DEFINITIONS HAVE_OPENSSL) SET(tmp_includes ${HTTPD_INCLUDE_DIRECTORIES} ${OPENSSL_INCLUDE_DIR}) SET_TARGET_PROPERTIES(abs PROPERTIES INCLUDE_DIRECTORIES "${tmp_includes}") @@ -859,7 +859,7 @@ GET_PROPERTY(tmp_includes TARGET ab PROPERTY INCLUDE_DIRECTORIES) # getting duplicate manifest error with ApacheMonitor # ADD_EXECUTABLE(ApacheMonitor support/win32/ApacheMonitor.c support/win32/ApacheMonitor.rc) # SET(install_targets ${install_targets} ApacheMonitor) -# SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/ApacheMonitor.pdb) +# SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:ApacheMonitor>) # SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES WIN32_EXECUTABLE TRUE) # SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES COMPILE_FLAGS "-DAPP_FILE -DLONG_NAME=ApacheMonitor -DBIN_NAME=ApacheMonitor.exe ${EXTRA_COMPILE_FLAGS}") # TARGET_LINK_LIBRARIES(ApacheMonitor ${EXTRA_LIBS} ${HTTPD_SYSTEM_LIBS} comctl32 wtsapi32) @@ -916,7 +916,7 @@ INSTALL(DIRECTORY include/ DESTINATION include ) INSTALL(FILES ${other_installed_h} DESTINATION include) INSTALL(FILES ${installed_mod_libs_exps} DESTINATION lib) -INSTALL(FILES "${CMAKE_BINARY_DIR}/libhttpd.exp" DESTINATION LIB) +INSTALL(FILES "$<TARGET_LINKER_FILE_DIR:libhttpd>/libhttpd.exp" DESTINATION LIB) INSTALL(FILES support/ctlogconfig DESTINATION bin) IF(INSTALL_MANUAL) # Silly? This takes a while, and a dev doesn't need it. |