Add PROJECT_ROOT/app for inclusion for getopt_tests

main
kamiccolo 2 years ago committed by Rosen Penev
parent e1efef9d84
commit 643165fda6

@ -39,7 +39,7 @@ foreach(entry ${SAMPLES})
set_target_properties(${target} PROPERTIES set_target_properties(${target} PROPERTIES
COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS}) COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS})
list(APPEND APPLICATIONS ${target}) list(APPEND APPLICATIONS ${target})
target_include_directories(${target} PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find unused.h target_include_directories(${target} PRIVATE ${PROJECT_SOURCE_DIR}/src) # To find enforce.hpp
if ( NOT ${target} MATCHES ".*test.*") # don't install tests if ( NOT ${target} MATCHES ".*test.*") # don't install tests
install( TARGETS ${target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install( TARGETS ${target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif() endif()
@ -54,20 +54,20 @@ endif()
add_executable( getopt-test getopt-test.cpp ../app/getopt.cpp) add_executable( getopt-test getopt-test.cpp ../app/getopt.cpp)
list(APPEND APPLICATIONS getopt-test) list(APPEND APPLICATIONS getopt-test)
target_include_directories(getopt-test PRIVATE target_include_directories(getopt-test PRIVATE
${CMAKE_SOURCE_DIR}/app ${PROJECT_SOURCE_DIR}/app
) # To find getopt.hpp ) # To find getopt.hpp
add_executable( metacopy metacopy.cpp metacopy.hpp ../app/getopt.cpp) add_executable( metacopy metacopy.cpp metacopy.hpp ../app/getopt.cpp)
list(APPEND APPLICATIONS metacopy) list(APPEND APPLICATIONS metacopy)
target_include_directories(metacopy PRIVATE target_include_directories(metacopy PRIVATE
${CMAKE_SOURCE_DIR}/app ${PROJECT_SOURCE_DIR}/app
) # To find getopt.hpp ) # To find getopt.hpp
add_executable( path-test path-test.cpp ../app/getopt.cpp) add_executable( path-test path-test.cpp ../app/getopt.cpp)
list(APPEND APPLICATIONS path-test) list(APPEND APPLICATIONS path-test)
set_target_properties( path-test PROPERTIES OUTPUT_NAME path-test ) set_target_properties( path-test PROPERTIES OUTPUT_NAME path-test )
target_include_directories(path-test PRIVATE target_include_directories(path-test PRIVATE
${CMAKE_SOURCE_DIR}/app ${PROJECT_SOURCE_DIR}/app
) # To find getopt.hpp ) # To find getopt.hpp
install( TARGETS metacopy RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install( TARGETS metacopy RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

Loading…
Cancel
Save