File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 1+ # Define executable and its properties
12add_executable (${PROJECT_NAME} App.cpp)
2-
3- # depends on CoreLibrary
4- target_link_libraries (${PROJECT_NAME} PRIVATE CoreLibrary)
5-
6- # set the output directory for the executable
3+ target_link_libraries (${PROJECT_NAME} PRIVATE Core)
74set_target_properties (${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /${PROJECT_NAME} )
Original file line number Diff line number Diff line change 11set (INCROOT ${PROJECT_SOURCE_DIR} /library/include /Core)
22set (SRCROOT ${PROJECT_SOURCE_DIR} /library/src/Core)
33
4- # all header files
4+ # Define header and source file lists
55set (LIBRARY_HEADERS
66 ${INCROOT} /Lib.hpp
77)
88
9- # all source files
109set (LIBRARY_SOURCES
1110 ${SRCROOT} /Lib.cpp
1211)
1312
14- # define library
15- add_library (CoreLibrary STATIC ${LIBRARY_HEADERS} ${LIBRARY_SOURCES} )
13+ # Define library and its properties
14+ add_library (Core STATIC ${LIBRARY_HEADERS} ${LIBRARY_SOURCES} )
15+ target_include_directories (Core PUBLIC ${PROJECT_SOURCE_DIR} /library/include )
16+ target_compile_features (Core PUBLIC cxx_std_17)
1617
17- # we need this directory, and users of our library will need it too
18- target_include_directories (CoreLibrary PUBLIC ${PROJECT_SOURCE_DIR} /library/include )
19-
20- # all users of this library will need at least C++17
21- target_compile_features (CoreLibrary PUBLIC cxx_std_17)
22-
23- # IDEs should put the headers and sources in a nice place
18+ # Group headers and sources for IDE
2419source_group (TREE ${INCROOT} PREFIX "Headers" FILES ${LIBRARY_HEADERS} )
2520source_group (TREE ${SRCROOT} PREFIX "Sources" FILES ${LIBRARY_SOURCES} )
You can’t perform that action at this time.
0 commit comments