mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 05:21:49 +03:00
chore: use latest CMake subfolder name
This commit is contained in:
parent
3be7198f03
commit
ad24ee1273
@ -163,7 +163,7 @@ An example of how your new `CMakeLists.txt` file should look like. Note that if
|
|||||||
|
|
||||||
file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c )
|
file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c )
|
||||||
foreach( testsourcefile ${APP_SOURCES} )
|
foreach( testsourcefile ${APP_SOURCES} )
|
||||||
string( REPLACE ".c" "" testname ${testsourcefile} ) # File type. Example: `.c`, `.h`
|
string( REPLACE ".c" "" testname ${testsourcefile} ) # File type. Example: `.c`
|
||||||
add_executable( ${testname} ${testsourcefile} )
|
add_executable( ${testname} ${testsourcefile} )
|
||||||
|
|
||||||
if(OpenMP_C_FOUND)
|
if(OpenMP_C_FOUND)
|
||||||
@ -172,7 +172,7 @@ foreach( testsourcefile ${APP_SOURCES} )
|
|||||||
if(MATH_LIBRARY)
|
if(MATH_LIBRARY)
|
||||||
target_link_libraries(${testname} ${MATH_LIBRARY})
|
target_link_libraries(${testname} ${MATH_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
install(TARGETS ${testname} DESTINATION "bin/<foldername>") # Folder name
|
install(TARGETS ${testname} DESTINATION "bin/<foldername>") # Folder name. Do NOT include `<>`
|
||||||
|
|
||||||
endforeach( testsourcefile ${APP_SOURCES} )
|
endforeach( testsourcefile ${APP_SOURCES} )
|
||||||
```
|
```
|
||||||
@ -182,7 +182,7 @@ Include your new directory after the last subdirectory. Example:
|
|||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
...
|
...
|
||||||
add_subdirectory(divide_and_conquer)
|
add_subdirectory(numerical_methods)
|
||||||
add_subdirectory(<foldername>)
|
add_subdirectory(<foldername>)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user