forked from nlohmann/json
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nlohmann#2279 from nlohmann/issue1818
Add test for target_include_directories
- Loading branch information
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
add_test(NAME cmake_target_include_directories_configure | ||
COMMAND ${CMAKE_COMMAND} | ||
-G "${CMAKE_GENERATOR}" | ||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
-Dnlohmann_json_source=${PROJECT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/project | ||
) | ||
add_test(NAME cmake_target_include_directories_build | ||
COMMAND ${CMAKE_COMMAND} --build . | ||
) | ||
set_tests_properties(cmake_target_include_directories_configure PROPERTIES | ||
FIXTURES_SETUP cmake_target_include_directories | ||
) | ||
set_tests_properties(cmake_target_include_directories_build PROPERTIES | ||
FIXTURES_REQUIRED cmake_target_include_directories | ||
) |
11 changes: 11 additions & 0 deletions
11
test/cmake_target_include_directories/project/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
project(DummyImport CXX) | ||
|
||
add_executable(with_private_target main.cpp) | ||
target_include_directories(with_private_target PRIVATE ${nlohmann_json_source}/include) | ||
set_target_properties(with_private_target PROPERTIES CXX_STANDARD 11) | ||
|
||
add_executable(with_private_system_target main.cpp) | ||
target_include_directories(with_private_system_target PRIVATE SYSTEM ${nlohmann_json_source}/include) | ||
set_target_properties(with_private_system_target PROPERTIES CXX_STANDARD 11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <nlohmann/json.hpp> | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
nlohmann::json j; | ||
|
||
return 0; | ||
} |