mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-30 18:16:53 -04:00
Resolve sibling component paths relative to the current directory
ps2xRecomp and ps2xAnalyzer reached ps2xRuntime through CMAKE_SOURCE_DIR, which is the top-level source directory of whatever build is running. That holds only when this repository is itself the top level; adding it to another project with add_subdirectory() made both components look for ps2xRuntime/cmake/ReleaseMode.cmake under the consuming project and fail at configure time. Use CMAKE_CURRENT_SOURCE_DIR-relative paths, as ps2xRecomp already does for its ps2xRuntime include directory and ps2xRuntime does for its own cmake include. Note that each component declares its own project(), so PROJECT_SOURCE_DIR is not an alternative here.
This commit is contained in:
@@ -27,8 +27,8 @@ add_library(ps2_analyzer_lib STATIC ${PS2ANALYZER_LIB_SOURCES})
|
||||
|
||||
target_include_directories(ps2_analyzer_lib PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/ps2xRecomp/include
|
||||
${CMAKE_SOURCE_DIR}/ps2xRuntime/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../ps2xRecomp/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../ps2xRuntime/include
|
||||
)
|
||||
|
||||
target_link_libraries(ps2_analyzer_lib PUBLIC
|
||||
@@ -50,7 +50,7 @@ install(TARGETS ps2_analyzer ps2_analyzer_lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/ps2xRuntime/cmake/ReleaseMode.cmake")
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/../ps2xRuntime/cmake/ReleaseMode.cmake")
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
EnableFastReleaseMode(ps2_analyzer_lib)
|
||||
|
||||
@@ -130,7 +130,7 @@ install(DIRECTORY include/
|
||||
DESTINATION include
|
||||
)
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/ps2xRuntime/cmake/ReleaseMode.cmake")
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/../ps2xRuntime/cmake/ReleaseMode.cmake")
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
EnableFastReleaseMode(ps2_recomp_lib)
|
||||
|
||||
Reference in New Issue
Block a user