]> granicus.if.org Git - check/commitdiff
Fix bug with CMake project variable
authorMikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Sat, 8 Jun 2019 11:54:32 +0000 (13:54 +0200)
committerMikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Sat, 8 Jun 2019 11:54:32 +0000 (13:54 +0200)
"
I tried to embed the check source code into my project in a "3rdparty" folder. Turns out that the build fails because of the usage of CMAKE_PROJECT_NAME instead of PROJECT_NAME in the check CMakeLists.txt

CMAKE_PROJECT_NAME is the name of the topmost project, that is in my case my own project.
Changing to PROJECT_NAME worked fine.
"

https://github.com/libcheck/check/issues/194

Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
CMakeLists.txt

index 7577d8608dd8dee0d41bf6ff88eba5fdeb579c8c..c8466ae9f091aa204a1c13e29afdd992ba33a222 100644 (file)
@@ -376,7 +376,7 @@ endif()
 ###############################################################################
 # Export project, prepare a config and config-version files
 set(LIB_INSTALL_DIR lib CACHE FILEPATH "lib INSTALL DIR")
-set(EXPORT_NAME ${CMAKE_PROJECT_NAME})
+set(EXPORT_NAME ${PROJECT_NAME})
 include(CMakePackageConfigHelpers)
 configure_package_config_file(
     ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EXPORT_NAME}-config.cmake.in