Enforces that either static or dynamic libs are built --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -542,7 +542,7 @@ option(CGNS_USE_SHARED "Link programs to the CGNS shared library" "ON") if (CGNS_ENABLE_FORTRAN) add_library(cgns_static STATIC ${cgns_FILES} $) else (CGNS_ENABLE_FORTRAN) - add_library(cgns_static STATIC ${cgns_FILES}) + add_library(cgns_static STATIC EXCLUDE_FROM_ALL ${cgns_FILES}) endif (CGNS_ENABLE_FORTRAN) # Needed to work around a CMake > 3.8 bug on Windows with MSVS and Intel Fortran set_property(TARGET cgns_static PROPERTY LINKER_LANGUAGE C) @@ -598,7 +598,9 @@ if(CGNS_BUILD_SHARED) endif(CGNS_BUILD_SHARED) # Set the install path of the static library +if(NOT CGNS_BUILD_SHARED) install(TARGETS cgns_static ARCHIVE DESTINATION lib) +endif() # Set the install path of the shared library if(CGNS_BUILD_SHARED) # for windows, need to install both cgnsdll.dll and cgnsdll.lib @@ -650,7 +652,6 @@ install(FILES ${headers} # Tools # ######### -add_subdirectory(tools) ######### # Tests #