Skip to content

Rename CMake project from stdlib to fortran_stdlib #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14.0)
project(stdlib Fortran)
project(fortran_stdlib Fortran)
enable_testing()

# Follow GNU conventions for installation directories
Expand Down Expand Up @@ -56,7 +56,7 @@ endif()

add_subdirectory(src)

install(EXPORT fortran_stdlib-targets
NAMESPACE fortran_stdlib::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/fortran_stdlib"
install(EXPORT ${PROJECT_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
14 changes: 7 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,26 @@ set(SRC
${outFiles}
)

add_library(fortran_stdlib ${SRC})
add_library(${PROJECT_NAME} ${SRC})

set(LIB_MOD_DIR ${CMAKE_CURRENT_BINARY_DIR}/mod_files/)
set_target_properties(fortran_stdlib PROPERTIES
set_target_properties(${PROJECT_NAME} PROPERTIES
Fortran_MODULE_DIRECTORY ${LIB_MOD_DIR})
target_include_directories(fortran_stdlib PUBLIC
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${LIB_MOD_DIR}>
$<INSTALL_INTERFACE:include>
)

if(f18errorstop)
target_sources(fortran_stdlib PRIVATE f18estop.f90)
target_sources(${PROJECT_NAME} PRIVATE f18estop.f90)
else()
target_sources(fortran_stdlib PRIVATE f08estop.f90)
target_sources(${PROJECT_NAME} PRIVATE f08estop.f90)
endif()

add_subdirectory(tests)

install(TARGETS fortran_stdlib
EXPORT fortran_stdlib-targets
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
macro(ADDTEST name)
add_executable(test_${name} test_${name}.f90)
target_link_libraries(test_${name} fortran_stdlib)
target_link_libraries(test_${name} ${PROJECT_NAME})
add_test(NAME ${name}
COMMAND $<TARGET_FILE:test_${name}> ${CMAKE_CURRENT_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
4 changes: 2 additions & 2 deletions src/tests/system/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_executable(test_sleep test_sleep.f90)
target_link_libraries(test_sleep fortran_stdlib)
target_link_libraries(test_sleep ${PROJECT_NAME})

add_test(NAME Sleep COMMAND $<TARGET_FILE:test_sleep> 350)
set_tests_properties(Sleep PROPERTIES TIMEOUT 1)
set_tests_properties(Sleep PROPERTIES TIMEOUT 1)