diff --git a/CMakeLists.txt b/CMakeLists.txt index 14953667f7..bc0247e902 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,9 +156,16 @@ endif() # in .github/workflows/non_vendored.yml # NOTE: Set the global output directories after the subprojects have had their go at it -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + # Force all .lib and .dll into bin for windows + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +else() + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +endif() # Python if (SURELOG_WITH_PYTHON) @@ -529,7 +536,10 @@ foreach(gen_src ${surelog_generated_SRC}) endforeach() add_library(surelog ${surelog_SRC} ${surelog_generated_SRC}) -set_target_properties(surelog PROPERTIES PUBLIC_HEADER include/Surelog/surelog.h) +set_target_properties(surelog PROPERTIES + PUBLIC_HEADER include/Surelog/surelog.h + SOVERSION "${SURELOG_VERSION_MAJOR}.${SURELOG_VERSION_MINOR}" +) configure_file(${PROJECT_SOURCE_DIR}/include/Surelog/config.h.in ${GENDIR}/include/Surelog/config.h) target_compile_options(surelog PUBLIC @@ -807,15 +817,15 @@ endif() install( TARGETS surelog EXPORT Surelog - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Surelog) if(NOT SURELOG_USE_HOST_ANTLR) install( TARGETS antlr4_static EXPORT Surelog - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Surelog) endif() @@ -828,20 +838,20 @@ if(NOT SURELOG_USE_HOST_UHDM) install( TARGETS capnp kj EXPORT Surelog - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/uhdm + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/uhdm) endif() install( TARGETS uhdm EXPORT Surelog - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/uhdm + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/uhdm) endif() if (SURELOG_WITH_PYTHON) install( DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/python - DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog-python) endif() install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/pkg DESTINATION share/surelog) @@ -966,13 +976,13 @@ if (WIN32) FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/surelog.dir/surelog.pdb ${LIBANTLR4_BINARY_DIR}/runtime/$.pdb CONFIGURATIONS Debug RelWithDebInfo - DESTINATION ${CMAKE_INSTALL_LIBDIR}/surelog) + DESTINATION ${CMAKE_INSTALL_LIBDIR}) install( FILES ${UHDM_BINARY_DIR}/CMakeFiles/uhdm.dir/uhdm.pdb ${Cap\'n\ Proto_BINARY_DIR}/src/capnp/CMakeFiles/capnp.dir/capnp.pdb ${Cap\'n\ Proto_BINARY_DIR}/src/kj/CMakeFiles/kj.dir/kj.pdb CONFIGURATIONS Debug RelWithDebInfo - DESTINATION ${CMAKE_INSTALL_LIBDIR}/uhdm) + DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() endif() diff --git a/Makefile b/Makefile index 295972e215..3935c7f6ed 100644 --- a/Makefile +++ b/Makefile @@ -150,5 +150,5 @@ test_install_pkgconfig: uninstall: $(RM) -r $(PREFIX)/bin/surelog - $(RM) -r $(PREFIX)/lib/surelog + $(RM) -r $(PREFIX)/lib/libsurelog* $(RM) -r $(PREFIX)/include/Surelog diff --git a/README.md b/README.md index e7bbeea600..619bd56634 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ or or make release_with_python -make install (/usr/local/bin and /usr/local/lib/surelog by default, +make install (/usr/local/bin and /usr/local/lib by default, use PREFIX= for alternative location) ``` @@ -250,7 +250,7 @@ target_link_libraries( surelog) * By default Surelog does not build the Python API, See [`src/README`](src/README.md) * The Python API is operating on the Preprocessor and Parser ASTs. It is not supporting elaboration. Post-elaborated API seekers need to the use UHDM C/C++ API. * The file [`slformatmsg.py`](src/API/slformatmsg.py) illustrates how messages can be reformated. - * Place a modified version of this file either in the execution directory, or install directory /usr/local/lib/surelog/python + * Place a modified version of this file either in the execution directory, or install directory /usr/local/lib/surelog-python * A simple example of creating a new error message and generating errors can be found here: [`python_listener.py`](src/API/python_listener.py) @@ -258,7 +258,7 @@ target_link_libraries( surelog) * The complete Python API is described in the following files: [`SLAPI.h`](src/API/SLAPI.h) [`vobjecttypes`](src/API/vobjecttypes.py) - * Waivers can be installed in slwaivers.py files in the execution directory or install directory /usr/local/lib/surelog/python + * Waivers can be installed in slwaivers.py files in the execution directory or install directory /usr/local/lib/surelog-python ### Large design compilation on Linux * It is recommanded to use the -lowmem -mp options in conjunction for large designs. diff --git a/cmake/configs/Surelog.pc.in b/cmake/configs/Surelog.pc.in index 73fec6953e..5fb82ef25e 100644 --- a/cmake/configs/Surelog.pc.in +++ b/cmake/configs/Surelog.pc.in @@ -1,6 +1,6 @@ prefix="@CMAKE_INSTALL_PREFIX@" exec_prefix="${prefix}" -libdir="@CMAKE_INSTALL_FULL_LIBDIR@/surelog" +libdir="@CMAKE_INSTALL_FULL_LIBDIR@" includedir="@CMAKE_INSTALL_FULL_INCLUDEDIR@" Name: @PROJECT_NAME@ diff --git a/cmake/configs/SurelogConfig.cmake.in b/cmake/configs/SurelogConfig.cmake.in index bf13cf6af5..21140aad2b 100644 --- a/cmake/configs/SurelogConfig.cmake.in +++ b/cmake/configs/SurelogConfig.cmake.in @@ -7,6 +7,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/SurelogTargets.cmake) set_and_check(SURELOG_BIN_DIR @CMAKE_INSTALL_FULL_BINDIR@) set_and_check(SURELOG_INCLUDE_DIR @CMAKE_INSTALL_FULL_INCLUDEDIR@) set_and_check(SURELOG_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@) -set_and_check(SURELOG_LIB_DIR @CMAKE_INSTALL_FULL_LIBDIR@/surelog) +set_and_check(SURELOG_LIB_DIR @CMAKE_INSTALL_FULL_LIBDIR@) check_required_components(Surelog) diff --git a/src/README.md b/src/README.md index 2c525a0044..c96dceca19 100644 --- a/src/README.md +++ b/src/README.md @@ -17,7 +17,7 @@ make or make debug -make install (/usr/local/bin and /usr/local/lib/surelog by default, use PREFIX= for alternative locations) +make install (/usr/local/bin and /usr/local/lib by default, use PREFIX= for alternative locations) To make with Python you have to add the option to build/cmake: -DSURELOG_WITH_PYTHON=1 ```