diff --git a/CMakeLists.txt b/CMakeLists.txt index 8be586a1..bf6a2d0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,6 +268,9 @@ if(TESTS) message(FATAL_ERROR "Python3 and Numpy are required for MOPAC testing (testing can be disabled with -DTESTS=OFF)") endif() enable_testing() + add_executable(mopac-api-test) + target_link_libraries(mopac-api-test mopac-core) + add_subdirectory(include) add_subdirectory(tests) endif() diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 00000000..1ab8df15 --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,18 @@ +# Molecular Orbital PACkage (MOPAC) +# Copyright (C) 2021, Virginia Polytechnic Institute and State University +# +# MOPAC is free software: you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# MOPAC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +target_sources(mopac-api-test PRIVATE mopac_api_f.F90) +target_sources(mopac-api-test PRIVATE mopac_api_internal.F90) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 08100971..04b48ae2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -31,24 +31,7 @@ macro(add_mopac_test _name _files) ${CMAKE_BINARY_DIR}/mopac${CMAKE_EXECUTABLE_SUFFIX} ${HOF_ERROR} ${_files}) endmacro() -#=============================================== -add_executable(mopac-api-test) -target_link_libraries(mopac-api-test mopac-core) -if (STATIC_BUILD) - target_link_options(mopac-api-test PUBLIC "-static") -endif() -# Create a list of source files (src_list) with the .F90 extension -set(src_list - mopac_api_test - ) -#----------------------------------------------- -# Add a list of source files to the target -foreach(idx IN LISTS src_list) - target_sources(mopac-api-test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${idx}.F90) -endforeach() -target_sources(mopac-api-test PRIVATE ${CMAKE_SOURCE_DIR}/include/mopac_api_internal.F90) -target_sources(mopac-api-test PRIVATE ${CMAKE_SOURCE_DIR}/include/mopac_api_f.F90) -#=============================================== +target_sources(mopac-api-test PRIVATE mopac_api_test.F90) add_subdirectory(INDO-dev) add_subdirectory(keywords)